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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Frenchtom811
Resolver I
Resolver I

List differences between two columns of two table

Hello everyone, I have a good one for you!  Please refer to the below screen grab.

 

I have two tables.  The first table contains item numbers listed on each customer's price sheet.  The item numbers are class specific meaning that a particular item number will not appear in more than one class.  However, a particular item number can and often does appear under more than one customer.  Table 2 is the master item number file.   Every item number is unique (non-repeating) and is assigned to a single class.

 

I am trying to come up with a way of listing the differences between what the customer has in their price sheet (Customer Table) and what is in the Master Table.  This will tell me the customers who are missing item numbers as well as the identity of these missing item numbers.  Referring to the below screen grab, if I set my slicer to Class A, Joe and Bob would be listed with their respective missing item numbers.  If I selected Class B, I would get no results becuase only Billy has access to Class B and his price sheet contains all available Class B item numbers.  If I selected Class C, the output woould show Joe = 330, 331 and 333; Bob = 330 and 331.

 

Any idea how I can do this?  Most content I have found calls for duplicating tables and making a list comparison.  I was hoping there is an easier way.  Thanks!  Capture1.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Frenchtom811  ,

Here are the steps you can follow:

1. Enter Power query, select Merge queries as New in Home, use [Customer Table] as the main table, column Class as the associated point, and select Left Outer

v-yangliu-msft_0-1613608741930.jpeg

2. Select all the columns of the merged table in the power query, right-click and select Remove Duplicates

v-yangliu-msft_1-1613608741936.png

3. Create calculated column.

Flag =
var _1=
SELECTCOLUMNS(FILTER(ALLSELECTED('Customer Table'),[Class]=EARLIER([Class])),"1",[Item Number])
return
IF([Item Number] in _1,1,0)

4. Place [Flag] in Filters, is=0

v-yangliu-msft_2-1613608741937.jpeg

5. Result.

v-yangliu-msft_3-1613608741938.png

You can downloaded PBIX file from here.

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi  @Frenchtom811  ,

Here are the steps you can follow:

1. Enter Power query, select Merge queries as New in Home, use [Customer Table] as the main table, column Class as the associated point, and select Left Outer

v-yangliu-msft_0-1613608741930.jpeg

2. Select all the columns of the merged table in the power query, right-click and select Remove Duplicates

v-yangliu-msft_1-1613608741936.png

3. Create calculated column.

Flag =
var _1=
SELECTCOLUMNS(FILTER(ALLSELECTED('Customer Table'),[Class]=EARLIER([Class])),"1",[Item Number])
return
IF([Item Number] in _1,1,0)

4. Place [Flag] in Filters, is=0

v-yangliu-msft_2-1613608741937.jpeg

5. Result.

v-yangliu-msft_3-1613608741938.png

You can downloaded PBIX file from here.

 

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.

Hello @Anonymous , you did it! I will mark yours as the solution however there is one minor correction.  The Master Table is the main table and the customer table is secondary.

parry2k
Super User
Super User

@Frenchtom811 can you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors