List.RemoveMatchingItems

This function eliminates all instances of specified values in list2 from list1. If the values from list2 are not found in list1, the original list is returned. An optional parameter, equationCriteria,...

Syntax

List.RemoveMatchingItems(list1 as list, list2 as list, optional equationCriteria as any) as list

About

This function eliminates all instances of specified values in list2 from list1. If the values from list2 are not found in list1, the original list is returned. An optional parameter, equationCriteria, can be provided to customize the equality testing process.

Explanation

Generate a list excluding the numbers 1 and 5 from the input list {1, 2, 3, 4, 5, 5}. Use the Power Query function MList.RemoveMatchingItems({1, 2, 3, 4, 5, 5}, {1, 5}) to achieve this. The output will be {2, 3, 4}.