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
Kgraham01
Frequent Visitor

Identifying if records from Table A are also in Table B

Hello, I am having trouble finding a solution for what doesn't feel like an unusual issue, I am new to power BI so I might be missing the obivious here. 

 

I am looking at two tables in Power BI desktop, and Table A which is a table of both customers and prospects and Table B contains our Budget. 

 

I wanted to add a column to Table A to identify which records have a Budget. Is there a simple DAX formula which will return a True/False or Y/N for which records have a budget? The relationship between the two tables is causing me issues because the prospects are are NULL in the column for customer number, since they do not yet have one. 

 

Any sugguestions or tip would be helpful. 

Thanks! 

1 ACCEPTED SOLUTION

I think I might have figured it out. But would love a 2nd look. 

So table A would be 

Customer NumberName
11111Customer A
22222Customer B
33333Customer C
 Prospect 1
 Prospect 2

 

And Table B would be 

Customer NumberNameBudget
11111Customer A500
22222Customer B600
11111Customer A200
22222Customer B100
11111Customer A400

 

I created a Many to Many relationship between the two tables using customer number 

Then added a column to Table A  with the fomula: 

IF('Table A'[Customer Number]IN DISTINCT('Table B'[Customer Number]),1,0)
 
Which was able to add a new column that shows a 1 if the the customer has a budget and a 0 if they have no budget. I believe I can then use this to create the measures and reports I need. 
 
Any sugguestions on making this easier, or more usable. I would appreciate. 
Thanks!
 

 

View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I think I might have figured it out. But would love a 2nd look. 

So table A would be 

Customer NumberName
11111Customer A
22222Customer B
33333Customer C
 Prospect 1
 Prospect 2

 

And Table B would be 

Customer NumberNameBudget
11111Customer A500
22222Customer B600
11111Customer A200
22222Customer B100
11111Customer A400

 

I created a Many to Many relationship between the two tables using customer number 

Then added a column to Table A  with the fomula: 

IF('Table A'[Customer Number]IN DISTINCT('Table B'[Customer Number]),1,0)
 
Which was able to add a new column that shows a 1 if the the customer has a budget and a 0 if they have no budget. I believe I can then use this to create the measures and reports I need. 
 
Any sugguestions on making this easier, or more usable. I would appreciate. 
Thanks!
 

 

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.