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.
Hi,
Thanks for your response. I have added all measures into my PBIX file and are recieving some errors.
Looking at ID 1796 in particalar I have the below data.
| ID | Date | Result |
| 1796 | 15/12/2021 | Pass |
| 1796 | 08/12/2021 | Pass |
| 1796 | 01/12/2021 | Pass |
| 1796 | 24/11/2021 | Pass |
| 1796 | 17/11/2021 | Pass |
| 1796 | 10/11/2021 | Pass |
| 1796 | 03/11/2021 | Pass |
| 1796 | 27/10/2021 | Pass |
| 1796 | 20/10/2021 | Pass |
| 1796 | 13/10/2021 | Pass |
| 1796 | 06/10/2021 | Pass |
| 1796 | 29/09/2021 | Pass |
| 1796 | 22/09/2021 | Pass |
| 1796 | 15/09/2021 | Pass |
| 1796 | 08/09/2021 | Pass |
| 1796 | 01/09/2021 | Pass |
| 1796 | 25/08/2021 | Fail |
I am seeing the below results which is not correct as this specific ID has a fail.
Any ideas?
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.