Forum Discussion

kaytrishjr's avatar
kaytrishjr
Frequent Visitor
6 years ago
Solved

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...
  • AntrikshSharma's avatar
    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] ) )
    )

     

  • v-diye-msft's avatar
    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] ) )
    )