Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

First Time Pass Count

I am trying to figure out how to get a count on the number of products that passed thier test on the first run. So I want a count of the rows where the first value in the status column is "Passed". E...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please refer to my pbix file to see if it helps you.

    Create a column first.

    Column 2 _passed =
    CALCULATE (
        MIN ( 'Table'[Pass/Fail] ),
        FILTER (
            'Table',
            'Table'[DATE] = EARLIER ( 'Table'[DATE] )
                && 'Table'[SN] = EARLIER ( 'Table'[SN] )
        )
    )
    

     

     

    Then create a measure.

    Measure_count =
    VAR _mindate =
        CALCULATE (
            MIN ( 'Table'[DATE] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[USER] = SELECTEDVALUE ( 'Table'[USER] )
                    && 'Table'[SN] = SELECTEDVALUE ( 'Table'[SN] )
            )
        )
    RETURN
        CALCULATE (
            COUNT ( 'Table'[Column 2 _passed] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Column 2 _passed] = "Passed"
                    && 'Table'[DATE] = _mindate
            )
        )
    

     

     

     

    If I have misunderstood your meaning, please provide your desired output with a screenshot.

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.