Merging queries causing duplicate rows in Power Query Excel

Anonymous
2023-05-06T14:28:08+00:00

I have a file with 20000 rows with City being one of the columns.

I have another file with 400 rows that gives the Country and Manager mapping for each City.

When I create a merge query of the first file with the second file, by connecting "City" from the 1st file to the "City" in the 2nd file, the output increased the rows to 37000.

There is no other common mapping, except City between the 2 files. Any solution please? thanks.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Andreas Killer 143.6K Reputation points Volunteer Moderator
2023-05-06T17:59:35+00:00

The behaviour is normal, there are duplicate Cities in at min one of the data. A Join is not a VLOOKUP, which returns only one item even if there are two or more matches!

If you perform a left outer join remove the duplicates in the right data set before the join.

Andreas.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2023-05-06T16:14:07+00:00

Hi Jan010404,

I’m Segunfunmi an Independent Advisor and Microsoft user like you. Thanks for posting the query here in this forum.

It sounds like you are performing a merge operation between two files based on the “City” column. The increase in the number of rows in the output file could be due to multiple matches between the “City” values in the two files. This can happen if there are duplicate “City” values in one or both of the files. Have you checked for duplicates in the “City” column of both files?

Best Regards, Segunfunmi

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful