Forum Discussion

efowler's avatar
efowler
Helper II
3 years ago
Solved

Distinct Count when looking at multiple fields in table

Hello...  I have a long standing challange to properly calucate what I call "Distinct Repair".   I have a sample data table attached which shows the overall data and column E shows what would be cons...
  • v-easonf-msft's avatar
    3 years ago

    Hi, efowler 

    Please check if formula below could help:

    Result =
    VAR min_Claim =
        MINX (
            FILTER (
                ALL ( 'Table' ),
                'Table'[Product SN] = EARLIER ( 'Table'[Product SN] )
                    && 'Table'[PFP] = EARLIER ( 'Table'[PFP] )
                    && 'Table'[Repair Date] = EARLIER ( 'Table'[Repair Date] )
            ),
            'Table'[Claim #]
        )
    RETURN
        IF ( 'Table'[Claim #] = min_Claim, 1, BLANK () )
    

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.