Forum Discussion

KipGum's avatar
KipGum
Microsoft Employee
3 years ago
Solved

Comparing two different columns based on a third column

Hi all,   I have the following table:   UpdateLevel1     DomainAndSam    AffectedObject   Level1                 contoso\User1       contoso\Group1 Level1                 contoso\Group9    con...
  • v-jialluo-msft's avatar
    3 years ago

    Hi KipGum ,

     

    Please follow these steps:

    (1) Create a new measure to select Level1

     

    UpdateLevel1 = 
    IF (
        ISFILTERED ( 'PrivilegedAccounts'[DomainAndSam] ),
        IF (
            MAX( 'PrivilegedAccounts2'[DomainAndSam] )
                IN VALUES ( PrivilegedAccounts[DomainAndSam] ),
            "Level1"
        )
    )
    

     

    (2) Create a new measure to select Level2

     

    UpdateLevel2 =
    VAR _in =
        SUMMARIZE (
            FILTER (
                ALL ( 'PrivilegedAccounts2' ),
                [DomainAndSam] IN VALUES ( PrivilegedAccounts[DomainAndSam] )
            ),
            [AffectedObject]
        )
    RETURN
        IF (
            ISFILTERED ( 'PrivilegedAccounts'[DomainAndSam] ),
            IF ( MAX ( 'PrivilegedAccounts2'[DomainAndSam] ) IN _in, "Level 2" )
        )
    

     


    (3)
    The end result

     

     

    Best Regards,

    Gallen Luo

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