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

How to add values that aren't in one table to another in different column

I'm trying to compare Table 1 and Table 2 and add Table 2 SKU items that are not found in SKU 1 to the bottom of SKU 2. I tried doing a left anti join (using table 2 as left table) to get the unique Table 2 SKUs, but I can't append them to the SKU2 column in table 1 b/c there is a circular reference. I tried using reference tables for both Table 1 and 2, and still ran into the same problem. 

 

 

mergeappend.JPG

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

I believe the usual pattern is to make 2 temp tables. Extract distinct values from sku 1 into one of them and distinct values from sku 2 into the other. Then make a 3rd table using a union query to combine those 2. You make have to wrap the union statement in another distinct to eliminate duplicate values.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Just to clarify, I can't have only distinct values in SKU2 in the desired output. 

 

Basically, I want to compare SKU1 (from table 1) and SKU (from table 2) and get the items from SKU (table 2) that are not in SKU1 (table 1). Then I want to append those into the SKU2 column in table 1. 

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.