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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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