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
kliz
Frequent Visitor

Cumulative Sum

Hello,
I am a beginner in powerbi and I want to compute the cumulative sum for each day, which includes the current day's sale amount and the cumulative sum of the previous day's sales. 
For example, let's say we have a table with columns for 'Date' and 'Amount':
Date                                                Amount
2024-04-01                                   100
2024-04-02                                   150
2024-04-03                                   200 
2024-04-04                                   120
The cumulative sum for each day would be:
For 2024-04-01: 100
For 2024-04-02: 100 (from 2024-04-01) + 150 = 250
For 2024-04-03: 250 (from 2024-04-02) + 200 = 450
For 2024-04-04: 450 (from 2024-04-03) + 120 = 570

How can i do that?

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@kliz YOu can try this measure, I took your example and generated the expected result.

 

Cumulative = CALCULATE(SUM(TabA[Value]),FILTER(ALL(TabA),TabA[Date]<=MAX('TabA'[Date])))
 
Tahreem24_0-1714409705415.png

 

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

View solution in original post

5 REPLIES 5
Tahreem24
Super User
Super User

@kliz YOu can try this measure, I took your example and generated the expected result.

 

Cumulative = CALCULATE(SUM(TabA[Value]),FILTER(ALL(TabA),TabA[Date]<=MAX('TabA'[Date])))
 
Tahreem24_0-1714409705415.png

 

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

what if for some days there is no values, how can i make it so that it reproduces the previous value to the current and so on till if finds the next currentday value?Capture d’écran 2024-04-30 133058.png

 

Thank you. It worked.

Greg_Deckler
Community Champion
Community Champion

@kliz Better Running Total - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you for your input. I watched your video and I'll keep that in mind. I tried to apply it to my data but i did not get the expected result is there something i should add?As you can see it brings the same values for the different type.As you can see it brings the same values for the different type.

 

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.