Yes, you can remove duplicates in Power BI, and the cleanest way is to do it in Power Query (the data transformation editor) before the data loads into your model. Select the column(s) that define what makes a row a duplicate, right-click, and choose Remove Duplicates. The operation keeps the first occurrence of each duplicate and drops the rest, and it is recorded as a query step you can edit or delete later.
What You'll Need
- Power BI Desktop installed on a Windows PC, or access to Power Query in Excel or Power Query Online
- A data source already loaded into your report (or open and ready to load)
- A clear idea of which column or combination of columns identifies a duplicate in your data
Step-by-Step
These steps are for Power BI Desktop. Menu labels can differ slightly between versions, but the Power Query interface has been stable for this operation.
- Open Power Query Editor. In Power BI Desktop, go to Home > Transform data (or click Transform Data in the Home ribbon). The Power Query Editor window opens, showing your queries in the left pane.
- Select the query. Click the table (query) that contains the duplicates in the Queries pane on the left.
- Select the column that identifies duplicates. Click the header of the column, for example OrderID or Email. To deduplicate on multiple columns, hold Ctrl (or Shift for a range) and click each column header.
- Remove the duplicates. Right-click one of the selected column headers and choose Remove Duplicates from the context menu. Alternatively, with the column(s) selected, go to Home > Remove Rows > Remove Duplicates.
- Review the result. Power BI keeps the first row it finds for each duplicate value and removes the rest. Scroll the preview to sanity-check that the row count and remaining values look right.
- Control which row is kept (optional). If you need to keep a specific record, for example the most recent one, sort the table first: click a date column header, then Sort Descending, and only then apply Remove Duplicates. Power Query keeps the first row after sorting, so the newest record survives.
- Check the applied steps. In the Query Settings pane on the right, under Applied Steps, you will see a Removed Duplicates step. Click the gear icon next to it to change which columns it applies to, or the X to undo it.
- Apply the changes. Click Home > Close & Apply to load the cleaned data into your Power BI data model. The deduplicated version is what your reports and visuals will now use.
Common Mistakes
- Deduplicating on the wrong column. Removing duplicates on a name column collapses different people who share a name. Use a unique key like an ID or, if none exists, select several columns together so the whole combination must match.
- Not sorting first. Without a sort step before Remove Duplicates, which row survives is effectively arbitrary. If "first" vs "last" matters, sort deliberately first.
- Case and whitespace surprises. Power Query comparisons for Remove Duplicates are case-sensitive, and " Bob" is not the same as "Bob". Clean your data first (Trim, Clean, or lowercase via Transform > Format) if these variations should count as duplicates.
- Deleting instead of deduplicating the source. Remove Duplicates only changes what Power BI loads. The underlying file or database keeps all rows, which is usually what you want, so do not expect the source to change.
- Applying it after other heavy steps. Deduplicate early in the Applied Steps list where possible; deduplicating after a merge or unpivot can produce unexpected results.
Tips
- Before removing duplicates, you can count them: right-click the column and use Group By on that column with a Count Rows aggregation, then filter Count > 1, to preview exactly which values repeat.
- Prefer fixing duplicates in Power Query over DAX. DAX functions like DISTINCT are for calculations within a measure, not for cleaning the loaded table.
- Because Remove Duplicates is a query step, it reapplies automatically every time the report refreshes, so new duplicates in the source are cleaned on each refresh with no extra work.
- For very large tables, duplicate removal over many columns can slow refresh. Deduplicating on a single key column is faster than on all columns.
- Keep a copy: right-click the query and choose Duplicate if you want both the raw and deduplicated versions available in the model.
Troubleshooting
- Duplicates still appear after removing them. Check that you ran Remove Duplicates on the right column and that hidden differences are not at play: trailing spaces, different capitalization, or numbers stored as text vs numbers. Apply Transform > Format > Trim and Lowercase, or fix the data type, before the Remove Duplicates step. Also check whether your visual is pulling from a different table or an old query.
- The wrong row was kept. Delete the Removed Duplicates step (click the X next to it in Applied Steps), insert a sort step before it, then reapply Remove Duplicates.
- Rows vanished that you did not expect. This almost always means the key column was too broad (for example a date or category rather than a unique ID). Undo the step and pick a narrower column or a multi-column combination.
- Changes not showing in the report. Make sure you clicked Close & Apply, not just closed the editor window, and refresh the report view if needed.
- Privacy or formula errors in Applied Steps. If the step errors out, open the formula bar and check the generated Table.Distinct syntax, or delete the step and recreate it. If a formula bar is not visible, enable it under the View tab.
Frequently Asked Questions
Does Remove Duplicates keep the first or last row?
It keeps the first row encountered in the table's current order and removes the rest. To control which row is first, add a sort step before Remove Duplicates.
Is Power BI duplicate removal case-sensitive?
Yes, Power Query treats "ABC" and "abc" as different values. Lowercase or capitalize the column first if you want them treated as matches.
Can I remove duplicates based on multiple columns?
Yes. Hold Ctrl and click each column header to select them together, then right-click and choose Remove Duplicates. Rows are removed only when the entire combination matches.
Does Remove Duplicates change my source data?
No. It only affects the data as loaded into Power BI. Your original file, database, or other source keeps every row.
Can I undo Remove Duplicates?
Yes. In Power Query Editor, find the Removed Duplicates entry in Applied Steps and click the X next to it, then click Close & Apply.
Will duplicates be removed on future refreshes?
Yes. Because it is a saved query step, it runs automatically each time the dataset refreshes, cleaning new duplicates from the source.