OpenBI Docs Buy

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
ParameterTypeDescription
listlistThe items to test.
conditionfunctionA 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

List.MatchesAll, List.AnyTrue, Table.MatchesAnyRows.

Last updated · OpenBI Studio 0.3.79