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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jimpatel
Post Patron
Post Patron

Logic

Hi,

 

Thanks for looking at post.

 

I got stuck with below scenario. Any help will be much appreciated.

 

I have 2 tables, 

Table 1: Data coming from excel and have 10 columns and several rows

Table 2: Data coming from SQL and have 3 columns and few 100s of rows

 

What i need is, any logic to merge two tables. That is, compare table 1 and 2, and if data not available in table 1 from table 2 then add only those data from table 2 to table 1 (for those 3 columns)

 

Any idea please?

1 ACCEPTED SOLUTION
DatawithDinesh
Resolver II
Resolver II

I'm not sure if i got what you a trying to do but try the below steps. I had similar requirement and was able to get it solved with the below steps:

In Power Query Editor, select Table 1.
Click on Home > Merge Queries.
Select Table 2 as the table to merge with.
Choose the columns that are common between the two tables (the columns you want to compare).
Select the Left Anti join. This will return only the rows from Table 2 that do not have a matching row in Table 1 based on the selected columns.
After the merge, you will see a new column with a table icon. Click on the Expand button (two arrows) next to this column.
Select the three columns from Table 2 that you want to add to Table 1.
Go back to the main Power Query Editor window.
Append the non-matching rows from Table 2 to Table 1.
Use Home > Append Queries and append the expanded result to Table 1.
Close and Apply | This process will ensure that only the unique data from Table 2 is added to Table 1.

View solution in original post

1 REPLY 1
DatawithDinesh
Resolver II
Resolver II

I'm not sure if i got what you a trying to do but try the below steps. I had similar requirement and was able to get it solved with the below steps:

In Power Query Editor, select Table 1.
Click on Home > Merge Queries.
Select Table 2 as the table to merge with.
Choose the columns that are common between the two tables (the columns you want to compare).
Select the Left Anti join. This will return only the rows from Table 2 that do not have a matching row in Table 1 based on the selected columns.
After the merge, you will see a new column with a table icon. Click on the Expand button (two arrows) next to this column.
Select the three columns from Table 2 that you want to add to Table 1.
Go back to the main Power Query Editor window.
Append the non-matching rows from Table 2 to Table 1.
Use Home > Append Queries and append the expanded result to Table 1.
Close and Apply | This process will ensure that only the unique data from Table 2 is added to Table 1.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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