Forum Discussion
Comparing two different columns based on a third column
- 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 resultBest Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I just tested this but it's returning only blanks. My table name is "PrivilegedAccounts2". I'm guessing that the line that reads:
'Table'[DomainAndSam] = Domain,was meant to read:
'Table'[DomainAndSam] = DomainSam,
Here's the code as I am testing it:
What do you have in the table visual? Any other table involved? I assumed only UpdateLevel1 is measure, the other two are columns?
- KipGum3 years ago
Microsoft Employee
I have another table called "PrivilegedAccounts" which has the exact same columns as "PrivlegedAccounts2". I have a slicer for DomainAndSam on "PrivilegedAccounts". I have the following Measure in "PrivilegedAccounts2" that populates "UpdateLevel1" with the selected DomainAndSam value from "PrivilegeAccounts":
UpdateLevel1 = VAR sele = SELECTEDVALUE(PrivilegedAccounts[DomainAndSam]) RETURN IF(ISFILTERED(PrivilegedAccounts[DomainAndSam]) && MAX(PrivilegedAccounts2[DomainAndSam]) = sele,"Level1","")