New Tool Radar

AI for Data & Spreadsheets

How to Remove Duplicate Rows with Power Query in Excel

Remove duplicate rows with Power Query by choosing the key columns first, so real repeat orders are not deleted.

Schematic illustration for How to Remove Duplicate Rows with Power Query in Excel: three numbered steps - From Table/Range; Select key columns; Remove Duplicates.

A list with the same customer entered twice will double-count in every total, but deleting duplicates by eye risks removing two genuinely different rows. Power Query removes duplicates on the columns you choose, so the decision about what counts as a duplicate is explicit and repeatable.

Prerequisites

  • Excel with Power Query
  • A table that may contain duplicate rows
  • A copy of the source file, so the original stays untouched.

Steps

  1. Select any cell in the table and go to Data, From Table/Range to open it in the Power Query Editor.
  2. Select the columns that define a duplicate, such as email address, and no other columns.
  3. Go to Home, Remove Rows, Remove Duplicates, and check the row count before and after.
  4. Read the removed rows in the preview by undoing the step once, and confirm each removed row really was a duplicate.
  5. Click Close and Load to return the cleaned table to Excel.

Worked example: Fictional newsletter sign-up list

The practice table below is a fictional five-row list after duplicates were removed. The count column is 1 per kept row, and the total is the number of kept rows. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

Email Name Count
[email protected] Amara Okafor 1
[email protected] Ben Whitfield 1
[email protected] Clara Jensen 1
[email protected] Dev Patel 1
[email protected] Elena Rossi 1
Total 5

Expected result. Five unique email addresses kept, each counted once, and the count is 5.

Limits

  • Two rows that differ in one column are not duplicates, so choose the key columns carefully.
  • Removing duplicates in Power Query does not change the source data, so the source list still holds the duplicates.

Sources

See all