Forum Discussion
Dynamic running total
I would like to create a running total based on different parameters (YTD, Last year (starting at 1/1-12/31),Trailing 12 mo,etc).
I have a table that has Date in column 1, total in column 2.
I have the DAX below caculating a running total, how would i configure it to match the parameters above?
Hey,
currently you have to create a measure for each "time calculation". A good starting point is to create a separate Calendar table and to read through these examples: https://www.daxpatterns.com/time-patterns/
In the future this will become much simpler, as you can read here:
Regards,
Tom
2 Replies
- PattemManoharCommunity Champion
thampton Based on the information that you have provided, please try this..
RunningTotal = CALCULATE(SUM(TotalColumn), FILTER(ALL(TableName),DateColumn <= EARLIER(DateColumn)) )
It will be always helpful if you can post some sample data and expected output.
- TomMartensSuper User
Hey,
currently you have to create a measure for each "time calculation". A good starting point is to create a separate Calendar table and to read through these examples: https://www.daxpatterns.com/time-patterns/
In the future this will become much simpler, as you can read here:
Regards,
Tom