Forum Discussion
kaytrishjr
6 years agoFrequent Visitor
DAX Formula for a cumulative line graph
I've read a couple of posts on how to do this but I still can't make mine work. I need the correct DAX formula to make my line graph figures cumulative by period. It's really the filter part of the f...
- 6 years ago
The X axis, are those months? A general running total pattern is like this. Try modifying it according to your needs and let me know.
Running Total = CALCULATE ( [Total Sales], FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ) ) - 6 years ago
Hi kaytrishjr
Added on the above posts, if there's no date column could be using for [date]<=max(table(date)), you can just take the period column as index, and create the measure similar as:
Running Total = CALCULATE ( [Total Sales], FILTER ( ALL ( 'Table' ), 'Table'[period] <= MAX ( 'Table'[period] ) ) )
AntrikshSharma
Community Champion
6 years agoThe X axis, are those months? A general running total pattern is like this. Try modifying it according to your needs and let me know.
Running Total =
CALCULATE (
[Total Sales],
FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
Tahreem24
Super User
6 years agoFor Cumulative COlumn use the below DAX:
Column = CALCULATE(SUM(Table[SalesColumn]),ALL(Table),Table[DateColumn]<=EARLIER(Table[DateColumn]))
For Cumulative MEasure use the below DAX:
Measure = CALCULATE(SUM(Table[SalesColumn]),FILTER(ALL(Table),Table[DateColumn]<=Max(Table[DateColumn])))