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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Running total of a measure - take into account slicers

Hi,

I'm trying to calculate a running total of a measure that calculates a division. What I would like to have is what is shown in the table below. 

 

powerbi.PNG

 

NumberFailures is a basically a count when another column is not blank

NumberFailures=calculate( count(DataFailure[Part]); DataFailure[PartOperationalEnd] <> BLANK())  

 

NumberParts comes from another table where the total number of parts per year are summarized. 

NumberParts = sum(NoParts[NoParts])

 

So the FailureRate would be:

FailureRate =( NumberFailures/sum(NoParts[NoParts]))*100  

 

What I would like to have is a running average, to do so I'm trying to calculate first the running total of the FailureRate and then divide with the year number. For the running total I'm trying the solution suggested   here .

 

AccumFailureRate =

VAR Age = SELECTEDVALUE( NoParts[Year]; 0 )

RETURN

SUMX( FILTER(

              SUMMARIZE( NoWTG; NoWTG[Year];

                                "FailureRate"; ([NumberFailures]/sum(NoParts[NoParts])*100));

                   NoParts[Year] <= Age );

            [FailureRate] )  

 

However, I'm getting the results for all the data and not for the selections of the slicers. I understand it's because of the summarize that I'm aggregating for year, but I don't know how the calculation I need could be done.

Thank you!  

 

Finally, in the non sample data I have two more filters, also neither of them is taken into account when calculating the cummulative total

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I realized that i had to add an allselected

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Too complex not to have to recreate this. I don't see what I would expect where you would have an ALL or something that would be removing the slicer filter context.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I realized that i had to add an allselected

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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