Table.IsDistinct

This function checks if a table has any duplicate rows. It will return true if the rows are distinct, and false if there are duplicates. You can also specify which columns to check for duplication usi...

Syntax

Table.IsDistinct(table as table, optional comparisonCriteria as any) as logical

About

This function checks if a table has any duplicate rows. It will return true if the rows are distinct, and false if there are duplicates. You can also specify which columns to check for duplication using the optional parameter comparisonCriteria. If no criteria is specified, all columns will be checked for duplicates.

Explanation

Check if the table has unique values. Usage: Power Query MTable.IsDistinct( Table.FromRecords({ [CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Ringo", Phone = "232-1550"] }) ) Output: true Check if the table has unique values in a specific column. Usage: Power Query MTable.IsDistinct( Table.FromRecords({ [CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 5, Name = "Bob", Phone = "232-1550"] }), "Name" ) Output: false