List.Distinct
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Filters a list down by removing duplicates. An optional equation criteria value can be specified to control equality comparison. The first value from each equality group is chosen.
For more information about equationCriteria, see Parameter Values.
List.Distinct(list as list, optional equationCriteria as any, criteria as any) as list
| Argument | Description |
|---|---|
| list | The List to check. |
| optional equationCriteria | An equality group equation. |
| criteria | Filter criteria. |
List.Distinct({1, 2, 3, 2, 3}) equals {1, 2, 3}
List.Distinct({"a","b","A"}, each _) equals {"a", "b", "A"}
List.Distinct({"a","b","A"}, Comparer.FromCulture("en",true)) equals {"a", "b"}
List.Distint({[a="a",b=2],[a="b",b=3],[a="A",b=4]},
{ each [a] , Comparer.FromCulture("en", true) } )
equals { [ a = "a", b = 2 ],
// [a = "b", b = 3 ] }
Show: