List.ContainsAll
Whether every one of several values is in a list.
Group: List. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
List.ContainsAll(list as list, values as list, optional equationCriteria as any) as logical
| Parameter | Type | Description |
|---|---|---|
list | list | The list to look in. |
values | list | The values that must all be found. |
equationCriteria | any optional | How two values count as equal: a comparer or a key function. |
Returns
logical. true when each of the values is among the items; true too when values is empty.
Examples
Does the order have both?
List.ContainsAll({"Coffee", "Tea", "Milk"}, {"Tea", "Milk"})
true
Juice is missing
List.ContainsAll({"Coffee", "Tea", "Milk"}, {"Tea", "Juice"})
false