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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MagMag31
Regular Visitor

Calculate cumulative total value by date and Client

Hello,

can you help me please to add calculate column (cumul) that calculate the the cumulative budget total per client per month for each year as explained in the table

MagMag31_0-1692376945873.png

 

 

thank you

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This should ideally be solved with a measure but since you want a calculated column formula solution, write these calculated column formulas

Date = 1*("1/"&Data[Month]&"/"&Data[Year])
RT = CALCULATE(SUM(Data[Budget]),FILTER(Data,Data[Client Number]=EARLIER(Data[Client Number])&&Data[Date]<=EARLIER(Data[Date])))

Hope this helps.

Ashish_Mathur_0-1692404913276.png

 


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

View solution in original post

9 REPLIES 9
sergej_og
Super User
Super User

Maybe TOTALYTD() can halp in your case

Ashish_Mathur
Super User
Super User

Hi,

This should ideally be solved with a measure but since you want a calculated column formula solution, write these calculated column formulas

Date = 1*("1/"&Data[Month]&"/"&Data[Year])
RT = CALCULATE(SUM(Data[Budget]),FILTER(Data,Data[Client Number]=EARLIER(Data[Client Number])&&Data[Date]<=EARLIER(Data[Date])))

Hope this helps.

Ashish_Mathur_0-1692404913276.png

 


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

Hi @Ashish_Mathur ,

 

Hope you are well.

 

I'm having the same problem, but using measure, not new columns, can you give a little advice? Thanks in advance.

 

Please use the DATESYTD function within the CALCULATE function.


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

Hi @Ashish_Mathur ,

 

Thank you so much for your attention.

 

I tried the below DAX, but it did not work.

 

AmountNet_MTD = 
CALCULATE(
sum('Data'[credit_amount])
-sum('Data'[Deb_amount])
,DATESMTD('Data'[Accounting_Date])
)

 

 I used the Calculate as below, which is ok, but the total is incorrect.

 

AmountNet_MTD2 = 
 CALCULATE(sum('Data'[credit_amount])-sum('Data'[Deb_amount])
 ,FILTER('Data'
 ,'Data'[Accounting_Date_YYYYMM]=EARLIER('Data'[Accounting_Date_YYYYMM])
 &&'Data'[Accounting_Date]<=EARLIER('Data'[Accounting_Date])
&&'Data'[account_id]<=EARLIER('Data'[account_id])
 &&'Data'[Items_L1]="L1"))

 

image.png

Thanks again.

Hi,

Share some data to work with, explain the question and show the expected result.


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

Thank you so much @Ashish_Mathur it works !!👏

You are welcome.


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

@MagMag31 See if this helps:



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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