Forum

Duplicate rows bein...
 
Notifications
Clear all

Duplicate rows being created while merging queries

4 Posts
4 Users
0 Reactions
773 Views
 F S
(@fs)
Posts: 1
New Member
Topic starter
 

Hello all,

After I have merged queries, Power Query has created duplicate rows for which it found a N/A. How to resolve this without editing any of my other data sets? Everything else is working just fine. Only need a resolution for this. Thanks in advance.

 
Posted : 20/01/2023 3:26 am
Riny van Eekelen
(@riny)
Posts: 1195
Member Moderator
 

It would be helpful if you could upload a file containing some data and the queries you have merged.

Don't forget to press "Start upload" before you submit your reply.

 
Posted : 20/01/2023 4:13 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi FS,
The second table should have a single record for the keys used for merging. If 2 or more rows from the second table are matching the merge criteria, when you expand the merged tables this action will copy the first table record for all the rows found in second table.

 
Posted : 20/01/2023 7:21 am
(@jerryd)
Posts: 3
New Member
 

You should be using "The second table" which you say "a single record for the keys used for merging" as your primary file (top file in the Merge dialog window. The default Merge is a "Left Outer Join (all from first, matching from second)".

If for some reason you can't use the second table as the first merge table, change the Merge Type to "Right Outer (all from second, matching from first)".

You can use multiple columns as keys like both First Name and Last Name, but be sure you select them in the same order. If you select more than one key field, the order# will appear above the column header.

The other possibility is you have inaccurate keys in one or both files where the keys are different but the data is the same. There's no easy fix for that though!

 
Posted : 20/01/2023 12:31 pm
Share: