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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Combine table in power query to add rows from one table to another

Hello,

I want to get the all the columns data from table 2 to table 1 where table2[column2]<> table1[column2]

 

This is just an example, I have lot of rows and columns that I want to merge b/w the two tables and want to match the column 2 of table 2 to table 1 and where column 2 data don't match, I want to add all the rows from 2nd table to 1st table.

 

table 1:

Column1Column2Column3Column2aColumn5Column6
AlphaAB01076ActiveAB01076CFinalActive
AlphaAB01079ActiveAB01079APrimaryActive
AlphaAB01083ActiveAB01083ZPrimaryActive
AlphaAB01163ActiveAB01163BFinalActive
AlphaAB01167ActiveAB01167CFinalActive
AlphaAB01168ActiveAB01168AFinalActive

 

table 2:

Column1Column2Column3Column2aColumn5Column6
AlphaAB01083ActiveAB01083ACandidateActive
AlphaAB01086ActiveAB01086ACandidateActive
AlphaAB01163ActiveAB01163DCandidateNew
AlphaAB01168ActiveAB01168BCandidateActive
AlphaAB01171ActiveAB01171ZCandidateActive

 

 

End result table 1:

 

Column1Column2Column3Column2aColumn5Column6
AlphaAB01076ActiveAB01076CFinalActive
AlphaAB01079ActiveAB01079APrimaryActive
AlphaAB01083ActiveAB01083ZPrimaryActive
AlphaAB01163ActiveAB01163BFinalActive
AlphaAB01167ActiveAB01167CFinalActive
AlphaAB01168ActiveAB01168AFinalActive
AlphaAB01086ActiveAB01086ACandidateActive
AlphaAB01171ActiveAB01171ZCandidateActive

 

 

1 ACCEPTED SOLUTION

@Anonymous 

per our discussion, i found a workaround for you. 

pls try if we can get the correct output.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hello Ryan,

 

Thanks for your help. Actaually what I was trying to do is delete the duplicats by doing merge on one and append on the other without creating a new table. But when I am trying to append it, it doesn't show the first table where I merged it. The reason is on the one I want to show all data has informtion on lot of columns that first one don't have it. But while doing that on the 2nd table where I want to append, it doesn't show the 1st table where I merged it.

@Anonymous 

for the first part, you can select append quries instead of append quries as new to avoid creaing new table.

1.png

 

I don't quite understand the rest of your reply, could you pls update your sample data and provide the expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

So I did the merge on table 1 and want to append in table 2 but when I try to append, it doesn't give me option of table 1.

if you have time I can show you live data on screen share.

@Anonymous 

per our discussion, i found a workaround for you. 

pls try if we can get the correct output.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Anonymous 

i know the reason , it's becasue in table 2 we used table's info. 

So we can't append table 1 and table 2 direclty

1.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Also tried to create a new table and try to append that with table 1, that also didn't work, thinking I will remove the duplicate. Can you let me know what is the option now to do the append

@Anonymous 

select table 1 and append quries as new

1.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I have added lot of calculated columns in table 1 in data view of PBI, so I wanted to keep the table 1. 

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@Anonymous 

pls see the attachment below

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.