Table.Distinct

This function removes duplicate rows from a table. You can specify which columns to use for checking duplicates using the optional parameter equationCriteria. If equationCriteria is not provided, all ...

Syntax

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

About

This function removes duplicate rows from a table. You can specify which columns to use for checking duplicates using the optional parameter equationCriteria. If equationCriteria is not provided, all columns in the table will be checked. Power Query may offload certain operations to backend data sources (referred to as folding) and optimize queries by skipping unnecessary operations. As a result, there is no guarantee regarding which duplicate row will be kept. For instance, it is not safe to assume that the first row with unique column values will be retained. To ensure predictable behavior in duplicate removal, it is recommended to buffer the table first using Table.Buffer.

Explanation

Example 1 Eliminate any duplicate rows from the table. Usage: Use Power Query M function Table.Distinct with Table.FromRecords to remove duplicate rows from the table. Output: The resulting table will have only unique rows. Example 2 Remove any duplicate rows from column [b] in the given table. Usage: Use Power Query M function Table.Distinct with Table.FromRecords and specify the column [b] to remove duplicate rows specifically from that column. Output: The resulting table will have unique rows based on the values in column [b].