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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Super User
Super User

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!:
Power BI Cookbook Third Edition (Color)

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

I realized that i had to add an allselected

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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