Forum Discussion
Calculating First Time Pass Rate
- Anonymous8 years ago
Anonymous create the following and you should have your ans
FirstTime = CALCULATE(MIN(Data[Start_Time]), ALLEXCEPT(Data[Serial_Number]))
FirstTimePassed = CALCULATE(MIN(Data[Start_Time]), ALLEXCEPT(Data[Serial_Number]), FITLER(Data[Test_Status] = "Passed"))
FirstTimePassedCount =
VAR SerialCount = Calculate(DISTINCTCOUNT(Data[Serial_Number], FILTER(ALL(Data)))
VAR PassedCount = Calculate(DISTINCTCOUNT(Data[Serial_Number], FILTER(Data, Data[FirstTime] = Data[FirstTimePassed]))
Return PassedCount/SerialCount
Hi Veles,
Many thanks for getting back to me so quickly. I have implemented what you suggested but it isnt quite working for me, probably my finger trouble being new to BI.
To find the issue I stripped back your code so I could just see the first time pass count. This seemed to be returning 0, so I stripped back the SUMX statement leaving the return value as below:
VAR FirstPasses = IF ( CALCULATE ( MAX ( Combined_temp[Test_Status] ), FILTER ( Combined_temp, Combined_temp[Start_time] = MIN( Combined_temp[Start_time] ) ) ) = "PASSED", 1, 0 )
When I threw this into a table next to the serial numbers it looks like it is doing the right thing. There is a 1 for each serial number that was a first time pass. However when I put the SUMX around it and show the data with a weekly grouped start time the value is always 0, like its not summing the result of the IF. Any ideas?
Anonymous create the following and you should have your ans
FirstTime = CALCULATE(MIN(Data[Start_Time]), ALLEXCEPT(Data[Serial_Number]))
FirstTimePassed = CALCULATE(MIN(Data[Start_Time]), ALLEXCEPT(Data[Serial_Number]), FITLER(Data[Test_Status] = "Passed"))
FirstTimePassedCount =
VAR SerialCount = Calculate(DISTINCTCOUNT(Data[Serial_Number], FILTER(ALL(Data)))
VAR PassedCount = Calculate(DISTINCTCOUNT(Data[Serial_Number], FILTER(Data, Data[FirstTime] = Data[FirstTimePassed]))
Return PassedCount/SerialCount
- Anonymous8 years agoNot applicable
Fantastic, many thanks. This did indeed solve the problem and I now have First Time Pass Rate being calculated.