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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Siza
Regular Visitor

How to match 2 different columns from 2 different tables

May you please help me with this problem, I have 2 differnet datasets( Table A and Table B) the tables have a column called a UCR which can be used to link both tables. I want to be able to see the non-matching UCR's that are in table A but not in table B, I used the formula ucr_match = if(RELATED(TableA[UCR])=TableB[UCR], "Match","Non Match")

 

The problem is that some of the UCR's were wrongly captured by end users which then shows as if there's a non-match when in fact there is a match. Take for example Table A ucr has 4 six's where as table B has 3 six's and these are supposed to be a match. 

Table A                                                             Table B 

UCR: 2JP01536666CINV4300840884M            UCR: 2JP0153666CINV4300840884M

 

What alternative can I use? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Siza ,

I created some data:

TableA:

vyangliumsft_0-1679017395692.png

TableB:

vyangliumsft_0-1679017446283.png

 

Here are the steps you can follow:

1. Create calculated column.

 

Column =
VAR _column=SELECTCOLUMNS('TableA',"UCR",'TableA'[UCR])
return
IF(
    'TableB'[UCR] in _column,"Match","Non Match")

 

2. Result:

vyangliumsft_2-1679017395694.png

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @Siza ,

I created some data:

TableA:

vyangliumsft_0-1679017395692.png

TableB:

vyangliumsft_0-1679017446283.png

 

Here are the steps you can follow:

1. Create calculated column.

 

Column =
VAR _column=SELECTCOLUMNS('TableA',"UCR",'TableA'[UCR])
return
IF(
    'TableB'[UCR] in _column,"Match","Non Match")

 

2. Result:

vyangliumsft_2-1679017395694.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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