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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Dunner2020
Post Prodigy
Post Prodigy

Cumulative sum of measure

Hi there,

 

I have a monthly average measure that calculates the average based on the month which looks like as follow:

 

Average Monthly = if(ISBLANK([sum_measure]),BLANK(),AVERAGEX(ALL(Dates[RY Year]),[sum_measure]))
 
I created another measure that calculates the cumulative sum of the average monthly measure
 
Cumulative sum = CALCULATE(SUMX(VALUES(Dates[RY Month Number]),[Average Monthly]),
FILTER(ALLSELECTED(Dates),Dates[RY Month Number]=MAX(Dates[RY Month Number])))
 
 
However, it does not produce the desired output. Following is the output generated by above-mentioned measures:

Screenshot 2020-10-14 190912.jpg

 
 

Could anyone guide me where I made the mistake?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Dunner2020 , Try <=, if that is not a typo

 

Cumulative sum = CALCULATE(SUMX(VALUES(Dates[RY Month Number]),[Average Monthly]),
FILTER(ALLSELECTED(Dates),Dates[RY Month Number]<=MAX(Dates[RY Month Number])))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Dunner2020 , Try <=, if that is not a typo

 

Cumulative sum = CALCULATE(SUMX(VALUES(Dates[RY Month Number]),[Average Monthly]),
FILTER(ALLSELECTED(Dates),Dates[RY Month Number]<=MAX(Dates[RY Month Number])))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.