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
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
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.