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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Cumulative sum by year not working for measure

I Read multiple posts and tried multiple variants to write this formula but it isn't working as expected.

 

jbrandao_0-1627977261900.png

 

Simply put, I want "Measure 3" to be running total of Measure Tax Due.

This is the code I'm using for Measure 3:

 

Measure 3 =
var maxdate = max(years[year])
return
calculate([Tax Due], years[year]<=maxdate, All(years))
 
--> The calculation seems to be right on the last year - all the other values seem messed up...
 
I also tried using fields formatted as date:
 
jbrandao_1-1627977463217.png

 

but got exactly the same result:

 

jbrandao_2-1627977510570.png

@Anonymous 

 

Any help would be highly appreciated!

 

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

This is supposed to be matrix, right? I'm a little confused about your data,like below:

vyalanwumsft_0-1628129641814.pngvyalanwumsft_1-1628129694815.png

If use table ,it will show right.

vyalanwumsft_2-1628129785460.png

So can you share more information about your data or share .PBIX to remove sensitive information?

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , you should prefer separate year/date table

 

Measure 3 =
calculate([Tax Due], filter(allselected(year), years[year]<=max(years[year])))

 

or

 

Measure 3 =
calculate([Tax Due], filter(allselected(year), years[Date]<=max(years[Date])))

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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