Forum Discussion
Anne1234
4 years agoFrequent Visitor
Running Total for 100 columns
Hello community! I am trying to calculate a running total in the Power Query Editor for 100 columns and I am looking for a simpler solution than manually inserting a new column 100 times. I have ...
- 4 years ago
I have calculated the running total now after unpivoting with the help of here:
https://www.youtube.com/watch?v=EFQBMJ6JyCQ&t=313s
jdbuchanan71
Super User
4 years agoFor the running total I think you want 2 measures.
The first one is just the sum of the Demand column.
Demand Amount = SUM ( 'YourTable'[Demand] )
Then it is just a matter of adding the date field from your Dates table and having a measure like this.
Running Total =
VAR _End = MAX ( DATES[Date] )
RETURN
CALCULATE (
[Demand Amount],
FILTER ( ALLSELECTED ( DATES[Date] ),
DATES[Date] <= _End )
)