cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leightx Frequent Visitor
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
Super User II
Super User II

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

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!




leightx Frequent Visitor
Frequent Visitor

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

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
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors