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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mdgene
Helper I
Helper I

Cumulative Total to specific date

Please I have a measure that shows the cumulative measure upto specific date. But My measure still show values past the date expected. I have added a screen shot of the result below. 

 

If I use date in place of Month it works, but I will like to see it at month level. (screen shot attached). Please what is your advice

 

This is my dax measure

 

Cummulative Sold max  =
VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),'Forecast Revenue'[Forecast Category] = "sold")
RETURN
IF(SELECTEDVALUE('Date Table'[Date]) >[LastSaleDate] ,
BLANK(),
CALCULATE( 'Key Measures'[Sold],
FILTER(ALLSELECTED('Date Table'),
'Date Table'[Date] <= MAX('Date Table'[Date]) ) ))
 
 
 
mdgene_2-1644239670103.png

 

mdgene_1-1644239582211.png

 


 

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @mdgene ,

 

Has the problem been solved? If the problem persists, please delete the sensitive data and provide a sample pbix so that i can do more tests.https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am still on it. I will modify and send over. Thank you

amitchandak
Super User
Super User

@mdgene , Try like

 

Cummulative Sold max =
VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),filter(allselected('Forecast Revenue'),'Forecast Revenue'[Forecast Category] = "sold"))
RETURN
CALCULATE( 'Key Measures'[Sold],
FILTER(ALLSELECTED('Date Table'),
'Date Table'[Date] <= MAX('Date Table'[Date]) && SELECTEDVALUE('Date Table'[Date]) >[LastSaleDate] ))

 

I doubt you are using month from date table in first visual

 

or

 

Cummulative Sold max =
VAR LastSaleDate = CALCULATE(LASTDATE('Forecast Revenue'[Closed Date]),filter(allselected('Forecast Revenue'),'Forecast Revenue'[Forecast Category] = "sold"))
RETURN
CALCULATE( 'Key Measures'[Sold],
FILTER(ALLSELECTED('Date Table'),
'Date Table'[Date] <= MAX('Date Table'[Date]) && SELECTEDVALUE('Date Table'[Date]) < [LastSaleDate] ))

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 , I tested the two query, query 1, was returning blank. while query 2 was behaving just like my query. also I am using the date column. Thank you

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors