Forum Discussion
Column value bases on match in another table
Table 1- Name = ‘AADUsers’
UserPrincipalName | DisplayName |
User One | |
User Two | |
User Three | |
User Five |
Table 2 – Name = ‘InScope’
UserPrincipalName | DisplayName |
User One | |
User Five | |
User Ten |
I’d like to make a column on Table 1 (AADUsers) that is boulean Yes/No field if the ‘UserPrincipalName’ exists in table 2 (InScope)
Like this: -
Table 1 – ‘AADUsers’
UserPrincipalName | DisplayName | IsInScope |
User One | Yes | |
User Two | No | |
User Three | No | |
User Five | Yes |
Can anyone assist with the DAX expression for this?
HI, davidtoyne
just adjust tablename and column name
try below for column codeColumn = var a = LOOKUPVALUE(U2[user name],U2[user name],U1[username]) RETURN IF(a<>BLANK(),"yes","no")If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years ago
Hi, davidtoyne
Dangar332 gives a solution that you can try to use, and below there is a different solution you can refer to it as well
New Column:
IsInScope = IF ( COUNTROWS ( FILTER ( InScope, InScope[UserPrincipal] = AADUsers[UserPrincipal] ) ) > 0, "Yes", "No" )
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
2 Replies
- Dangar332
Resident Rockstar
HI, davidtoyne
just adjust tablename and column name
try below for column codeColumn = var a = LOOKUPVALUE(U2[user name],U2[user name],U1[username]) RETURN IF(a<>BLANK(),"yes","no")If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi, davidtoyne
Dangar332 gives a solution that you can try to use, and below there is a different solution you can refer to it as well
New Column:
IsInScope = IF ( COUNTROWS ( FILTER ( InScope, InScope[UserPrincipal] = AADUsers[UserPrincipal] ) ) > 0, "Yes", "No" )
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum