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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JC2022
Helper III
Helper III

Cumulative Sales

Hi,

How do I create a cumulative Sales measure for the attached Sales table. So February is the sum of January and February. March is the sum of January, February and March. etc. 

I have a few Tiers (category levels) and some filters on it.

Can you please help me out?

 

Dummy data 1.png

2 REPLIES 2
amitchandak
Super User
Super User

@JC2022 , If this is your source format, I doubt this the best data for power bi.

 

First Unpivot the header and get the month and year and create a date using that

https://goodly.co.in/unpivot-data-with-2-headers/

 

Also, use fill down, fill up. If needed

Power Query - Fill Up Fill Down: https://youtu.be/mC2ps0pFqBI

 

Then you can cumulative using a date table

 

examples

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))

Cumm Based on net = CALCULATE([Net], Window(1,ABS,0,REL, ADDCOLUMNS(ALLSELECTED('Item'[Brand]), "_net", [Net]),ORDERBY([_net],DESC)))

 

Cumm Based on Brand = CALCULATE([Net], Window(1,ABS,0,REL, ADDCOLUMNS(ALLSELECTED('Item'[Brand]), "_net", [Net]),ORDERBY('Item'[Brand],asc)))

 

Running Total/ Cumulative: https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=41

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

Thank you! the cumulative sales measure is now working but it is also summing all previous years. How do I do this per FiscalYear? So every FiscalYear starts with 0.

 

My formula is now:

Cumulative EUR Sales = CALCULATE(SUM(Append3[EUR Sales]),filter(all('Calendar Posting Date'[Date]),'Calendar Posting Date'[Date] <=max('Calendar Posting Date'[Date])))

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.