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 Anonymous ,
Please try the following formula:
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 )Average time = AVERAGEX ( VALUES ( 'Table'[ID] ), [Datediff] )CountResultPerID =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Result] ),
ALLEXCEPT ( 'Table', 'Table'[ID] )
)only recieve Pass =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
FILTER ( 'Table', 'Table'[Result] = "Pass" && [CountResultPerID] = 1 )
)recieve Pass then Fail =
VAR Firstday =
CALCULATE ( MIN ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
FILTER (
'Table',
'Table'[Date] = Firstday
&& 'Table'[Result] = "Pass"
&& [CountResultPerID] = 2
)
)
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.
- Anonymous4 years agoNot applicable
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?
- v-kkf-msft4 years agoCommunity Support
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.