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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
montgd
Frequent Visitor

Need to split cumulative revenue into the revenue by month

I have P&L data that is organized as such

 

January 2020 - 10,000

February 2020 18,000

March 2020, 31,000

 

I need to be able to undo the cumulative sum and get the value for each month.  So the expected result would be

January 2020 - 10,000

February 2020 - 8,000

March 2020 - 13,000 

 

Does anyone have any idea on how this can be accomplished?  Thanks for your help.

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @montgd , 

You could refer to my sample for details.

Measure = SUM(T2[amount])-CALCULATE(SUM(T2[amount]), FILTER(ALLSELECTED(T2), T2[date]=DATE(YEAR(MIN(T2[date])), MONTH(MIN(T2[date]))-1,1)))

 

Best Regards,
Zoe Zhi

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

View solution in original post

4 REPLIES 4
dax
Community Support
Community Support

Hi @montgd , 

You could refer to my sample for details.

Measure = SUM(T2[amount])-CALCULATE(SUM(T2[amount]), FILTER(ALLSELECTED(T2), T2[date]=DATE(YEAR(MIN(T2[date])), MONTH(MIN(T2[date]))-1,1)))

 

Best Regards,
Zoe Zhi

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

montgd
Frequent Visitor

Thank you very much - that worked perfectly.

Greg_Deckler
Super User
Super User

Yes, you should be able to use the approach found here, seems like your exact scenario:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Revenue-Reverse-YTD/m-p/373185#M111

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg


Thank you for your help.  I am still having trouble with this and let me make sure I explained it right.

 

This is the scenario:

 

January = 10,000

February = 25,000 (the 10,000 from January and 15,000 from February)

March = 40,000 (the 10,000 from January, 15,000 from February and 15,000 from March).

 

I tried the measure you showed me but I am getting some strange numbers.  Any ideas?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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