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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Cumulative Spend measure only works at higher granularity

I have a measure that is calculating the cumulative spend for different budget categories, and then applying it to a visual. 

CumulativeSpend = 
 VAR varDate = SELECTEDVALUE('Budget/Spend by Category'[Date])
 VAR varProduct = SELECTEDVALUE('Budget/Spend by Category'[Budget Category])
 RETURN
    CALCULATE(
        SUM('Budget/Spend by Category'[Value]),
        'Calendar'[Date] <= varDate,
        'Budget/Spend by Category'[Budget Category] = varProduct
    )

The visual

eloomis_0-1694196532256.png 

eloomis_4-1694196821687.png

I have this broken out by month, quarter, and year (all coming from a date table) so you can drill up and see the cumulative total by quarter, and then by year. This works in another visual which is not using my cumulative measure, but in the cumulative view, when I try to drill up the visual just goes blank. Any ideas on how to fix this?

 

eloomis_1-1694196692328.png

eloomis_2-1694196707297.png

eloomis_3-1694196735569.png

 

 

 

1 ACCEPTED SOLUTION
ChiragGarg2512
Solution Sage
Solution Sage

The measure should be created only using date table.

 

Preferably use one of these four methods: 

->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 Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

->Cumm Based on Date =

CALCULATE([Net], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

 

For more information refer to these video:

 

-> Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

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

 

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

https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

View solution in original post

2 REPLIES 2
ChiragGarg2512
Solution Sage
Solution Sage

The measure should be created only using date table.

 

Preferably use one of these four methods: 

->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 Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

->Cumm Based on Date =

CALCULATE([Net], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

 

For more information refer to these video:

 

-> Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

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

 

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

https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Anonymous
Not applicable

Thanks - this was very helpful.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.