List.RemoveItems
A list without any item that appears in a second list.
Group: List. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
List.RemoveItems(list1 as list, list2 as list) as list
| Parameter | Type | Description |
|---|---|---|
list1 | list | The list to remove from. |
list2 | list | The values to remove. |
Returns
list. The items of list1 not found in list2, every occurrence removed.
Examples
Without the discontinued products
List.RemoveItems({"Coffee", "Tea", "Milk", "Tea"}, {"Tea", "Juice"})
{"Coffee", "Milk"}
Both teas go; Juice was never there.