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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
macemit
Frequent Visitor

Failure rate running total based on counted fields

Hi,

 

I'm trying to calculate a running total of a count of product failures over a count of products shipped:

 

 Count of FailuresCount of ShippedWrongCorrectMethodology
June11001.0%1.0%1/100
July51005.0%3.0%6/200
August1510015.0%7.0%21/300
September1010010.0%7.8%31/400

 

When I create a measure: Failure rate = COUNTA('Case_Serial_Number'[Failure_Type]) / COUNTA('Serial_Numbers'[Serial]) - I get the failure rate for that month (the wrong column above). The calculation needs to take into account the specific months failures and shipped quantities and all the failures and shipped that preceded it. Thanks.

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Interkoubess
Solution Sage
Solution Sage

Hi @macemit,

 

I changed the field names ( to Shipped and Failed) and table name ( Table) and I created a date ( first date of every month) and finally created this measure:

Per = var CounFail = CALCULATE(SUM('Table'[ Failures]),FILTER(ALL('Table'[Date]),'Table'[Date]<=MAX('Table'[Date]))) var CounShip = CALCULATE(SUM('Table'[Shipped]),FILTER(ALL('Table'[Date]),'Table'[Date]<=MAX('Table'[Date]))) return DIVIDE(CounFail,CounShip,BLANK())

 

Capture.PNG

 

 

Hope it helps....

 

Ninter

Thanks for that. I was away from the office for a couple days hence the delay responding. Question: can I use counta instead of sum, as the fields are text and cannot be summed.

 

And 1 issue: serial number and failures came from 2 different tables. Is this how your measure is calculating? I'm getting a 'syntax for 'return' is incorrect'

 

Thanks.

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.

Top Solution Authors