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
HFarnes
New Member

Help Needed: Finding which ID number is in a different table

Hello

 

I am in need of some help

 

I have two tables Contacts and Courses. I need to find out which ID Numbers from the Contacts Tabel are in the Courses Table in a True/False formate. Which will then allow me to make a table visual to show a list of ID numbers that are True and those that are false.

 

I have tried a couple of different things, but nothing is working.

 

Any Help would be appreciated! 

1 ACCEPTED SOLUTION
MarcoRotta
Resolver I
Resolver I

Hi HFarnes.

 

My comments assume that you have two tables (which I'm labelling "Table1" and "Table2") both containing a numeric field called "ID".

 

If the tables are related, i.e. you have a relationship between the ID fields for both, just create a calculated column as:

 

Found = NOT(ISBLANK(RELATED(Table2[ID])))

 

The example above should be put on Table1 and returns TRUE if the ID is found on Table2. You can revert the way around and get the same result for Table2.

 

Let me know if you DON'T have a relationship between the IDs, because in that case the solution is different.

Regards.

View solution in original post

2 REPLIES 2
MarcoRotta
Resolver I
Resolver I

Hi HFarnes.

 

My comments assume that you have two tables (which I'm labelling "Table1" and "Table2") both containing a numeric field called "ID".

 

If the tables are related, i.e. you have a relationship between the ID fields for both, just create a calculated column as:

 

Found = NOT(ISBLANK(RELATED(Table2[ID])))

 

The example above should be put on Table1 and returns TRUE if the ID is found on Table2. You can revert the way around and get the same result for Table2.

 

Let me know if you DON'T have a relationship between the IDs, because in that case the solution is different.

Regards.

Just adding the option if the two ID fields do NOT have a relationship.

 

Found = ISNUMBER(CALCULATE(COUNT(Table2[ID]);FILTER(ALL(Table2[ID]);Table2[ID]=Table1[ID])))

 

This is a little bit trickier, but works like a charm. And of course there are other ways to do that "CALCULATE", and some colleagues here might disagree of my approach.

 

Regards.

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.