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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
HectorMSC
Frequent Visitor

How to create a cumulative sum of a measure that reset every year

Hello!

I need assistance to create a cumulative sum of a measure.

My table is called "Dashboard" and the measure is called "BudDep".

HectorMSC_0-1696974360868.png

 

Thats the way I want it, but I'm unable to do it correctly.

Thanks in advance.

1 ACCEPTED SOLUTION

Hi,

You hadn't followed a single suggestion from my previous post.  The solution is in the attached file.  The SUMIF() measures that you have written are the culprits for the poor performance of the file.

Hope this helps.

Ashish_Mathur_0-1697241223422.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

12 REPLIES 12
Syndicate_Admin
Administrator
Administrator

You should have a date or calendar table to relate your main table to.

You create the relationship between the 2 tables.

You create the measure as indicated by the other colleagues:

BudYTD = TOTALYTD([BudDep],calendar[Date])

BudYTD = calculate([BudDep],datesytd(Calendar[Date]))

where calendar[Date] corresponds to your date table and column

Ashish_Mathur
Super User
Super User

Hi,

Ensure that Year and Month name have been dragged from the Calendar Table.  Write this measure

Budget YTD = calculate([BudDep],datesytd(Calendar[Date],"31/12"))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Someone got this!  🤣

Hello! Thanks for the answer, unfortunately is not working. 

HectorMSC_0-1697222202963.png

I'm going to upload the pbix file, maybe that can help.

Hi,

You hadn't followed a single suggestion from my previous post.  The solution is in the attached file.  The SUMIF() measures that you have written are the culprits for the poor performance of the file.

Hope this helps.

Ashish_Mathur_0-1697241223422.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Wow.  People say I have no people skills...  🙄

Thanks for the help Ashish, thanks to your file now I know how to correctly do relationship with dates. When I tried before, I did this:

HectorMSC_0-1697468963067.png

And I noticed there was something wrong with the original column.


I didn't know this was the correct way to do the relationships.
Only date =
INT(Dashboard[Date])

This is working now, thanks so much.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ahmedx
Super User
Super User

pls try this

cumulative sum =

TOTALYTD([BudDep],'calendar'[Date])

Hello Ahmedx thanks for the answer.

This is what that formula got:

HectorMSC_0-1697148641289.png

 

Share sample pbix file to help you.

 

Hello Ahmedx, I can't upload pbix files here but attached is a wetransfer url.
https://we.tl/t-bL0RevyRIM

I have created the Calendar table as @Syndicate_Admin mentioned, but I think I don't know how to correctly do the relationship on dates.

HectorMSC_2-1697224034366.png

 

Just as reference, SUMIF Measure is the sum of sales of the same month for 2021 and 2022.
SUMIF Measure2 is the total sales of 2021 and 2022.
SUMIF Weight is a factor that must sum 1 for all the months of a year.
SUMIF BudgetYearly2 is the annual sales budget.
Weight * BudgetYearly2 is the monthly budget, BudDep.
And what I need is the cumulative sum of BudDep.

Thanks again for the help!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.