Forum Discussion
First Time Fix Rate
- Anonymous4 years ago
HI king98027,
You can use the following measure formulas to get the fist time flag and rate:
First time Flag = VAR currDate = MAX ( Table[Created Date] ) VAR last7dayCount = CALCULATE ( COUNT ( Table[Work Order Number] ), FILTER ( ALLSELECTED ( Table ), [Created Date] < currDate && [Created Date] >= currDate - 7 ), VALUES ( Table[Serial Number] ) ) RETURN IF ( last7dayCount > 1, 0, 1 )first time rate = VAR currSerialNumber = VALUES ( Table[Serial Number] ) VAR summary = SUMMARIZE ( Table, [Serial Number], [Work Order Number], [Created Date], "Flag", VAR last7dayCount = COUNTX ( FILTER ( ALLSELECTED ( Table ), [Serial Number] = EARLIER ( Table[Serial Number] ) && [Created Date] < EARLIER ( Table[Created Date] ) && [Created Date] >= EARLIER ( Table[Created Date] ) - 7 ), [Work Order Number] ) RETURN IF ( last7dayCount > 1, 0, 1 ) ) RETURN DIVIDE ( SUMX ( summary, [Flag] ), COUNTROWS ( summary ) )Regards,
Xiaoxin Sheng
Thanks, that looks like it would take care of my 2nd goal, but I'm still having a lot of difficulty trying to get to the 1st goal of implementing a first time fix value for each work order.
So I was able to make a little headway with Goal #1. Basically, I added a new column to the 'Work Order' Table, which went like this
However, the data doesn't seem to be calculating as expected when using 14 days rather than the example's 90 day requirement. I'm not sure exactly how it's defining what should be "1" or "0".
I quickly realize I'll have to filter for only 'Repair' work order types orders somehow.
The table using the new measure is below:
Measure in place: