Power Query Problems

How to Fix Duplicate Rows After Power Query Merge

Nimra MalikNimra Malik Nov 10, 2026 869 views

Question details

The user is experiencing duplicate rows or repeated fields when performing a merge in Power Query using a key column.

How to Fix Duplicate Rows and Fields in Power Query Merges
Product
Microsoft Excel
Device & OS
not provided
Scenario
Joining two data queries using a shared merge key column.
Observed behavior
The resulting merged query unexpectedly generates duplicated states, duplicate rows, or repeated column fields.
Before you start

Before troubleshooting, identify the exact key columns (e.g., State ID) used to merge the two tables and determine which query serves as the primary table versus the lookup table.

Solution 1Recommended

Remove or Aggregate Duplicate Keys Before Merging

Ensure the merge key in your secondary (lookup) query is completely unique to prevent a Cartesian product effect that multiplies rows.

When performing a Left Outer Join, Power Query retrieves all rows from the first table and matching rows from the second. If the second table has multiple rows with the same key, it will create duplicate rows in the final output.

1
Open the secondary query

Open the Power Query Editor and select your secondary query (e.g., the Harvested query) from the Queries pane on the left.

2
Select the key column

Click on the header of the key column (such as State ID) that you are using to match the tables.

3
Remove duplicates

Navigate to the 'Home' tab, click 'Remove Rows' in the ribbon, and select 'Remove Duplicates' to keep only unique keys.

4
Alternative: Group By

If you need to keep data from the duplicate rows, go to the 'Transform' tab and click 'Group By' to aggregate the records (e.g., Sum or Average) into a single row per key.

Remove or Aggregate Duplicate Keys Before Merging
Tip: Creating unique keys in the lookup table ensures a clean 1-to-1 or Many-to-1 join without unexpectedly multiplying the rows in your primary table.
Free Microsoft Office alternative

Try WPS Office for Your Data Analysis Needs

If you frequently struggle with complex Excel add-ins and tools like Power Query, consider switching to WPS Office. It provides a lightweight, highly compatible alternative with intuitive data processing tools, seamless format support, and a user-friendly interface.

  1. 1. Download the installer: Visit the official WPS website and download the free WPS Office installer.
  2. 2. Install the software: Run the installer and follow the quick on-screen instructions to complete the setup.
  3. 3. Open your Excel files: Launch WPS Spreadsheet and open your existing .xlsx files natively without losing any data formatting.
100% compatible with Microsoft Excel formats (.xlsx, .xls, .csv).Built-in, intuitive data processing, deduplication, and consolidation tools.Lightweight software that won't slow down your computer.Familiar interface requiring zero learning curve for Excel users.
microsoft office alternative - wps office

Frequently Asked Questions

Why does a Left Outer Join in Power Query create duplicate rows?

A Left Outer Join retrieves all rows from the first table and matching rows from the second. If the second table has multiple rows with the same merge key, Power Query will duplicate the row from the first table for every match it finds in the second table.

How can I find duplicates in my merge key column before joining?

In the Power Query Editor, select your key column, go to the 'Home' tab, click 'Keep Rows', and select 'Keep Duplicates'. This will filter the table to show only the duplicate values so you can investigate them before merging.

Does 'Remove Duplicates' in Power Query keep the first or last row?

Power Query's 'Remove Duplicates' feature keeps the first occurrence of the duplicate values based on the current sort order of the table, and it discards all subsequent matches.

Why are my column names showing prefixes like 'Table1.State ID' after merging?

This happens because the 'Use original column name as prefix' option was checked when you expanded the merged table column. You can fix this by deleting the expanded step in the 'Applied Steps' pane and re-expanding with that option unchecked.