Forum Discussion
Measure to Calculate the Defect Rate Not Obtaining the Correct Answer
I created two measures and used them to calculate the failure rate per 100,000 but did not receive the desired result.
The first measure was used to calculate the overall number of defects depending on bike number.
Total Defect By Bike No = COUNTROWS(FILTER('Data', 'Data'[Bike] = MAX(Data[Bike])))
The second measure was used to compute the defect rate based on 100,000 KM traveled.
Defect Rate per bike = [Total Defect By Bike No] / CALCULATE(SUM(Mileage[Mileage]), ALLEXCEPT(Mileage, Mileage[Bike]))*100000
The first measure was correct, but when it came to defect rate per bike, it used the total mileage of all bikes rather to a specific bike number to compute
The logic to the second measure seem correct but I am not sure where goes wrong.
Help would appreciate and thank you.
Please find attached the Excel sample file and the pibx file.
Hi,
PBI file attached.
Hope this helps.
16 Replies
- Amos_Lim
Resolver I
The "ALLEXCEPT" in
Defect Rate per bike = [Total Defect By Bike No] / CALCULATE(SUM(Mileage[Mileage]), ALLEXCEPT(Mileage, Mileage[Bike]))*100000
may have summed up all the bikes except the slected bike; how can it be reversed? i.e., only the bike in the slicer was selected to sum up the mileage.
- Ashish_Mathur
Super User
Hi,
Show the expected result very very clearly.
- Amos_Lim
Resolver I
Below is the expected results.
- Ashish_Mathur
Super User
Assuming Total Defect and Total Mileage are measures that you have already written, write this measure
Measure = divide([Total defect],[Total mileage])*10000