List.MatchesAny
Whether at least one item of a list meets a condition.
Group: List. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
List.MatchesAny(list as list, condition as function) as logical
| Parameter | Type | Description |
|---|---|---|
list | list | The items to test. |
condition | function | A function of one item that answers true or false. |
Returns
logical. true when the condition holds for some item; an empty list gives false.
Examples
Is any product a tea?
List.MatchesAny({"Coffee", "Green tea", "Milk"}, each Text.Contains(_, "tea"))
true
No refunds this week
List.MatchesAny({120, 80, 45}, each _ < 0)
false