List.IsDistinct

List

Returns true if the list contains no duplicate values.

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

Syntax

List.IsDistinct(list as list, optional equationCriteria as any) as logical

Parameters

NameTypeRequiredDescription
listlistYesThe list to check for uniqueness.
equationCriteriaanyNoAn optional equation criteria to control how equality is determined.

Return Value

logicalTrue if all values in the list are unique; false if any duplicates exist.

Remarks

List.IsDistinct checks whether every item in a list is unique. It returns true if all items are distinct, and false if any value appears more than once. This is a convenient data quality check — for example, verifying that a key column has no duplicate values before using it in a merge.

An empty list returns true (vacuous truth: no duplicates can exist). Null values are treated as equal to each other, so a list containing two or more nulls is not distinct. Comparison is case-sensitive for text by default; pass Comparer.OrdinalIgnoreCase for case-insensitive uniqueness checking.

List.IsDistinct is equivalent to List.Count(list) = List.Count(List.Distinct(list)) but expresses intent more clearly. When you need to validate uniqueness for a table column, pass the column as a list: List.IsDistinct(Table[ColumnName]).

Examples

Example 1: All values are distinct

List.IsDistinct({1, 2, 3, 4, 5})
Result
Result
1TRUE

Example 2: Duplicate values present

List.IsDistinct({1, 2, 3, 2, 5})
Result
Result
1FALSE

Example 3: Case-insensitive check

List.IsDistinct({"Apple", "apple", "Banana"}, Comparer.OrdinalIgnoreCase)
Result
Result
1FALSE

Example 4: Validate a key column has no duplicates

let
    Keys = {"ID-001", "ID-002", "ID-003", "ID-004"},
    IsUnique = List.IsDistinct(Keys)
in
    IsUnique
Result
Result
1TRUE

Compatibility

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