List.ContainsAny
Whether at least 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.ContainsAny(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 to look for. |
equationCriteria | any optional | How two values count as equal: a comparer or a key function. |
Returns
logical. true when one or more of the values is among the items; false when values is empty.
Examples
Any hot drink on the order?
List.ContainsAny({"Juice", "Tea"}, {"Coffee", "Tea"})
true
Ignoring capitals
List.ContainsAny({"juice", "water"}, {"Water", "Soda"}, Comparer.OrdinalIgnoreCase)
true