Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Inspection Dataset Measures

I have an inspection dataset similar to the below.   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   I ...
  • v-kkf-msft's avatar
    v-kkf-msft
    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 ) + 0
    Total 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.