List.Distinct Function in Power Query
The List.Distinct function return the given list after removing duplicates. If the list is empty, the result is an empty list. An optional equation criteria value can be specified to control equality comparison.
Syntax
List.Distinct(list as list, optional equationCriteria as any) as list
Example: Remove the duplicates from the list.
Power Query M
let source = {"India", "America", "Canada", "Japan", "Australia", "England", "America", "japan"}, return = List.Distinct(source) in return
The output of the above code is shown below:
Example: Remove duplicates after ignoring the case sensitivity of the text.
Power Query M
let source = {"India", "America", "Canada", "Japan", "Australia", "England", "America", "japan"}, return = List.Distinct(source, Comparer.OrdinalIgnoreCase) in return
The output of the above code is shown below: