Forum Discussion
Inspection Dataset Measures
- 4 years ago
Hi Anonymous ,
I modify these measures, please try them:
Datediff = VAR startdate = CALCULATE ( MIN ( 'Table'[Date] ), 'Table'[Result] = "Pass" ) VAR enddate = CALCULATE ( MIN ( 'Table'[Date] ), 'Table'[Result] = "Fail", 'Table'[Date] >= startdate ) RETURN DATEDIFF ( startdate, enddate, DAY ) + 0Total recieve Pass then Fail = SUMX ( VALUES ( 'Table'[ID] ), [recieve Pass then Fail] )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sanitized sample data that fully covers your issue. Your scenario 2 is not covered.
Please show the expected outcome based on the sample data you provided.
Hi,
Thanks for your response. Unfortunetely due to company confidentity I can only supply a sample dataset.
| ID | Date | Result |
| 1 | 01/01/2022 | Pass |
| 1 | 02/01/2022 | Fail |
| 2 | 01/01/2022 | Pass |
| 2 | 02/01/2022 | Pass |
| 2 | 03/01/2022 | Fail |
| 3 | 01/02/2022 | Pass |
Based upon the above dataset I would see the below outcomes for each scenario.
1. Average time it takes to fail after recieving a pass as the first result = 1.5 days
2. Count of distinct ID's that only ever recieve a Pass = 1
3. Count of distinct ID's that recieve a Pass as their first result then a Fail any time after the first Pass = 2
Hope this helps.