List.RemoveMatchingItems Function in Power Query
The List.RemoveMatchingItems function takes two lists and removes all occurrences of the second list values from the first list. If the values in list2 don't exist in list1, the original list is returned. An optional equation criteria value, equationCriteria, can be specified to control equality testing.
Syntax
List.RemoveMatchingItems(list1 as list, list2 as list, optional equationCriteria as any) as list
Example:
Power Query M
let Source = List.RemoveMatchingItems({100, "Ashish", 26, 60, 60, 40, "Katrina"}, {"ashish", 40, 60}) in Source
The output of the above code is shown below:
Example:
Power Query M
let Source = List.RemoveMatchingItems({100, "Ashish", 26, 60, 60, 40, "Katrina"}, {"ashish", 40, 60 }, Comparer.OrdinalIgnoreCase) in Source
The output of the above code is shown below: