Tricia Taylor | Data Solutions

Creating a Running Total Across Multiple Data Sources in Power BI

Creating a running total in Power BI is usually straightforward—until 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… fun. 😏

And if you’re using a Date Lookup Table? It won’t always help—especially when you have multiple transactions (like inventory moves, purchase orders, and sales) all landing on the same date. That’s when sorting gets tricky, and your running totals may go rogue.


💡 Here’s how to keep everything in line:

1. Append the data from all relevant sources in Power Query.
Make sure your column headers are consistent across the tables— especially for key attributes like Material, Customer, Order, etc.
    • Align all detail-level rows so they form a clean, unified table.

2. Sort with intention.
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.
Example:

= Table.Sort(#"Changed Type", {
    {"Component", Order.Ascending},
    {"Material", Order.Ascending},
    {"Date", Order.Ascending},
    {"SourceOrder", Order.Ascending},
    {"Business Partner", Order.Ascending}
})

3. Add an Index Column.
As your last step in Power Query, add an Index column. This locks in the sort order and ensures your DAX running total works as expected—even when you have multiple transactions on the same day.

Think of the Index as a breadcrumb trail—it tells DAX exactly how to walk through your data without tripping over duplicate dates or multiple entries.


This method has saved me more than once when building freight, inventory, and order-based dashboards.

It’s a small thing—but when your running totals match.
That’s dashboard delight, my friend!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *