Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Help with if statement for different values in other columns

I have a dataset below:   Location Name age income UK x teen low UK x adult low UK y teen high USA z adult low USA z adult high   I want to point out mistak...
  • v-yanjiang-msft's avatar
    3 years ago

    Hi Anonymous ,

    According to your description, here's my solution. Create a measure.

    Discrepancy found? =
    IF (
        COUNTROWS (
            FILTER (
                ALL ( 'Table' ),
                'Table'[Location] = MAX ( 'Table'[Location] )
                    && 'Table'[Name] = MAX ( 'Table'[Name] )
                    && (
                        'Table'[age] <> MAX ( 'Table'[age] )
                            || 'Table'[income] <> MAX ( 'Table'[income] )
                    )
            )
        ) > 0,
        "Yes",
        "No"
    )
    

    Get the correct result:

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

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