Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kaytrishjr
Frequent 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 formula I'm getting confused with. Here are my examples:

 

This is an example of the information I would be using;

Line graph info.JPG


This is the line graph I need and need the totals to be cumulative. 

PI Line graph.JPG

 

Thanks for your help!

 
 

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
AntrikshSharma
Super User
Super User

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] ) )
)

 

View solution in original post

v-diye-msft
Community Support
Community Support

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] ) )
)
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

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] ) )
)
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
AntrikshSharma
Super User
Super User

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] ) )
)

 

@kaytrishjr ,

For 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])))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.