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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
raghsal
New Member

Check if a value exist in another column

Hello. I need help please please.

 

I have two tables (Table1 and Table2) They both have ID column

 

I would like to check if the ID in Table 2 exist in Table 1 or not. 

 

Then I would like to create a new column in Table 1 (Exist column) with the values YES and NO.. Yes if it exists and NO if it doesn't.

 

Thanks so much

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi @raghsal  ,


You could create a new column by the following formula:

 

check =
VAR _SEL =
SELECTCOLUMNS ( 'Table (2)', "ID", [ID] )
RETURN
IF ( 'Table'[ID] IN _SEL, "YES", "NO" )

 

The final output is shown below:

table2.jpg

v-yalanwu-msft_0-1619416535591.png


Best Regards,
Community Support Team_ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi @raghsal  ,


You could create a new column by the following formula:

 

check =
VAR _SEL =
SELECTCOLUMNS ( 'Table (2)', "ID", [ID] )
RETURN
IF ( 'Table'[ID] IN _SEL, "YES", "NO" )

 

The final output is shown below:

table2.jpg

v-yalanwu-msft_0-1619416535591.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, it was really helpful for me.

LakshmanData5
Frequent Visitor

Did you try Conditional Column ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.