{"id":60,"date":"2025-10-01T02:20:20","date_gmt":"2025-10-01T02:20:20","guid":{"rendered":"https:\/\/trishtaylor.net\/?p=60"},"modified":"2025-10-01T02:20:20","modified_gmt":"2025-10-01T02:20:20","slug":"creating-a-running-total-across-multiple-data-sources-in-power-bi","status":"publish","type":"post","link":"https:\/\/trishtaylor.net\/?p=60","title":{"rendered":"Creating a Running Total Across Multiple Data Sources in Power BI"},"content":{"rendered":"\n<p><strong>Creating a running total in Power BI<\/strong> is usually straightforward\u2014until you need to pull in <strong>Sales Orders<\/strong>, <strong>Material<\/strong>, and <strong>Customer Information<\/strong> from multiple tables.<\/p>\n\n\n\n<p>When those details matter (and they often do in real-world reporting), things get a bit more\u2026 <em>fun<\/em>. \ud83d\ude0f<\/p>\n\n\n\n<p>And if you&#8217;re using a <strong>Date Lookup Table<\/strong>? It won\u2019t always help\u2014especially when you have multiple transactions (like inventory moves, purchase orders, and sales) all landing on the same date. That\u2019s when sorting gets tricky, and your running totals may go rogue.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 Here\u2019s how to keep everything in line:<\/h3>\n\n\n\n<p style=\"margin-right:var(--wp--preset--spacing--10);margin-left:var(--wp--preset--spacing--10)\"><strong>1. Append the data<\/strong> from all relevant sources in Power Query.<br>Make sure your <strong>column headers<\/strong> are consistent across the tables\u2014 especially for key attributes like <code>Material<\/code>, <code>Customer<\/code>, <code>Order<\/code>, etc.<br>\u00a0\u00a0\u00a0\u00a0\u2022 Align all detail-level rows so they form a clean, unified table.<\/p>\n\n\n\n<p><strong>2. Sort with intention.<\/strong><br>Before applying the running total, sort your data in Power Query using the exact column order you need for the accumulation logic to make sense.<br>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>= Table.Sort(#\"Changed Type\", {\n    {\"Component\", Order.Ascending},\n    {\"Material\", Order.Ascending},\n    {\"Date\", Order.Ascending},\n    {\"SourceOrder\", Order.Ascending},\n    {\"Business Partner\", Order.Ascending}\n})\n<\/code><\/pre>\n\n\n\n<p><strong>3. Add an Index Column.<\/strong><br>As your last step in Power Query, add an <strong>Index column<\/strong>. This locks in the sort order and ensures your DAX running total works as expected\u2014even when you have multiple transactions on the same day.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-large-font-size\"><strong>Think of the Index as a breadcrumb trail\u2014it tells DAX exactly how to walk through your data without tripping over duplicate dates or multiple entries.<\/strong><\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>This method has saved me <em>more than once<\/em> when building freight, inventory, and order-based dashboards.<\/p>\n\n\n\n<p>It\u2019s a small thing\u2014but when your running totals match.<br>That\u2019s <strong>dashboard delight<\/strong>, my friend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a running total in Power BI is usually straightforward\u2014until you need to pull in Sales Orders, Material, and Customer Information from multiple tables. When those details matter (and they often do in real-world reporting), things get a bit more\u2026 fun. \ud83d\ude0f And if you&#8217;re using a Date Lookup Table? It won\u2019t always help\u2014especially when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-power-bi"],"_links":{"self":[{"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":1,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":61,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions\/61"}],"wp:attachment":[{"href":"https:\/\/trishtaylor.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trishtaylor.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}