Table.Distinct

Table

Removes duplicate rows from a table based on all columns or specified criteria.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

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

Parameters

NameTypeRequiredDescription
tabletableYesThe table to remove duplicate rows from.
equationCriteriaanyNoA column name, list of column names, or comparer function used to determine which columns to check for duplicates. If omitted, all columns are compared.

Return Value

tableA table with duplicate rows removed.

Remarks

Table.Distinct removes duplicate rows from a table. Without equationCriteria, rows must match on every column to be considered duplicates. Pass a column name or list of column names to deduplicate based on specific columns only — the first occurrence of each unique value is kept.

Table.Distinct is similar to Table.RemoveDuplicates. The key difference is that Table.Distinct supports comparer functions in its criteria (e.g., Comparer.OrdinalIgnoreCase for case-insensitive matching), while Table.RemoveDuplicates takes a simple list of column names.

Examples

Example 1: Get distinct categories

Table.Distinct(Table.SelectColumns(Sales, {"Category"}))
Result
Category
1Widgets
2Gadgets
3Misc

Example 2: Distinct customers by name

Table.SelectColumns(Table.Distinct(Sales, "CustomerName"), {"CustomerName", "Product", "Region"})
Result
CustomerName
Product
Region
1AliceWidget AEast
2BobGadget BWest
3CharlieWidget CEast
4DianaWidget AWest

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks