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
omelei86
Frequent Visitor

Help! - Index cumulative sum

Hi 

I have 4 columns in my table 'Revenue': 

 

  • Customer number
  • Year
  • Month 
  • Revenue

 

I have created a line chart showing the cumulative revenue per month by using this measure:

 

 

Revenue **bleep** = 
CALCULATE( SUM(Revenue[revenue] ); FILTER( ALL ( Revenue[Month] ); Revenue[Month] <= MAX( Revenue[Month])))

 

 


Now I'd like to display a line chart showing the index between 2018 cumulative and 2019 cumulative. 

Hope you could help me out, 

 

Best, Matt

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @omelei86 ,

Can you please share some sample data for test? It will help to test and coding formulas.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

You could make 2 new calculated measures and add another filter to the Calculate formula for 'Revenue'[Year] = "2018" . . . "2019" 

 

Let me know how this works!

Thanks @Anonymous 

 

I am new to DAX so could you please help me creating my new measure(s)?

 

Thanks..

Anonymous
Not applicable

For 2018...

 

2018 Revenue =
CALCULATE( SUM(Revenue[revenue] ); FILTER( ALL ( Revenue[Month] ); Revenue[Month] <= MAX( Revenue[Month])), Revenue[Year] = 2018)

 

For 2019...

 

2019 Revenue =
CALCULATE( SUM(Revenue[revenue] ); FILTER( ALL ( Revenue[Month] ); Revenue[Month] <= MAX( Revenue[Month])), Revenue[Year] = 2019)

 

Or as one your could do...

 

2019 minus 2018 Revenue = 

CALCULATE( SUM(Revenue[revenue] ); FILTER( ALL ( Revenue[Month] ); Revenue[Month] <= MAX( Revenue[Month])), Revenue[Year] = 2019) - CALCULATE( SUM(Revenue[revenue] ); FILTER( ALL ( Revenue[Month] ); Revenue[Month] <= MAX( Revenue[Month])), Revenue[Year] = 2018)

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.