Power QueryExercises

Table.Distinct

Table function · By Tahir Nas · Examples run in our simulator · Published · Updated

Removes duplicate rows, optionally comparing only some columns.

When to use it

Use it to remove exact duplicate rows, or to keep one row per key by listing key columns. Clean the key columns first (trim, case) so near-duplicates are caught. When which row survives matters, sort first and buffer.

Syntax

Table.Distinct(table as table, optional equationCriteria as any) as table

Parameters

equationCriteria
A column name or list of columns to compare. Omit to compare whole rows.

Returns

The table with duplicates removed (first occurrence kept).

Example

Table.Distinct(#table({"Region", "Product", "Qty"}, {{"North", "Kite", 2}, {"South", "Reel", 5}, {"North", "Reel", 1}, {"West", "Kite", 4}}), {"Product"})

Result

RegionProductQty
NorthKite2
SouthReel5

Example: whole-row duplicates

Without a column list, two rows are duplicates only if every column matches.

Table.Distinct(#table({"Order", "Qty"}, {{1, 2}, {1, 2}, {1, 3}}))

Result

OrderQty
12
13

Both results are produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M, and checked on every build.

Good to know

Common mistakes

The matching command in Excel

Excel for Windows
Select the key columns > Home > Remove Rows > Remove Duplicates
What you see
Rows that repeat across the selected columns are dropped, with a case-sensitive comparison.

Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Working with duplicate values (Microsoft Learn).

Exercises that use Table.Distinct

Learn more

Related functions

Official documentation: Table.Distinct on Microsoft Learn.