Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
davidtoyne
New Member

Column value bases on match in another table

Table 1- Name = ‘AADUsers’

UserPrincipalName

DisplayName

User1@domain.com

User One

User2@domain.com

User Two

User3@domain.com

User Three

User5@domain.com

User Five

 

Table 2 – Name = ‘InScope’

UserPrincipalName

DisplayName

User1@domain.com

User One

User5@domain.com

User Five

User10@domain.com

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

User1@domain.com

User One

Yes

User2@domain.com

User Two

No

User3@domain.com

User Three

No

User5@domain.com

User Five

Yes

 

Can anyone assist with the DAX expression for this?

2 ACCEPTED SOLUTIONS
Dangar332
Super User
Super User

HI, @davidtoyne 

 

just adjust tablename and column name


try below for column code

 

Column = 
var a = LOOKUPVALUE(U2[user name],U2[user name],U1[username])
RETURN
IF(a<>BLANK(),"yes","no")

 

 

Dangar332_0-1709729164153.png

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

View solution in original post

v-yaningy-msft
Community Support
Community Support

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

vyaningymsft_0-1709794139350.png

New Column:

IsInScope =

IF (

    COUNTROWS (

        FILTER ( InScope, InScope[UserPrincipal] = AADUsers[UserPrincipal] )

    ) > 0,

    "Yes",

    "No"

)


Best Regards,
Yang
Community Support Team

 

If 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

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

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

vyaningymsft_0-1709794139350.png

New Column:

IsInScope =

IF (

    COUNTROWS (

        FILTER ( InScope, InScope[UserPrincipal] = AADUsers[UserPrincipal] )

    ) > 0,

    "Yes",

    "No"

)


Best Regards,
Yang
Community Support Team

 

If 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

Dangar332
Super User
Super User

HI, @davidtoyne 

 

just adjust tablename and column name


try below for column code

 

Column = 
var a = LOOKUPVALUE(U2[user name],U2[user name],U1[username])
RETURN
IF(a<>BLANK(),"yes","no")

 

 

Dangar332_0-1709729164153.png

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.