OpenBI Docs Buy

List.RemoveMatchingItems

A list without any item that matches one of a second list, optionally by your own rule of equality.

Group: List. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

List.RemoveMatchingItems(list1 as list, list2 as list, optional equationCriteria as any) as list
ParameterTypeDescription
list1listThe list to remove from.
list2listThe values to remove.
equationCriteriaany
optional
How two values count as equal: a comparer or a key function.

Returns

list. The items of list1 that match none of list2.

Examples

Remove every tea

List.RemoveMatchingItems({"Coffee", "Tea", "Milk", "Tea"}, {"Tea"})
{"Coffee", "Milk"}

Ignoring capitals

List.RemoveMatchingItems({"Coffee", "tea", "Milk"}, {"TEA"}, Comparer.OrdinalIgnoreCase)
{"Coffee", "Milk"}

List.RemoveItems, List.Difference.

Last updated · OpenBI Studio 0.3.79