OpenBI Docs Buy

List.MatchesAll

Whether every 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.MatchesAll(list as list, condition as function) as logical
ParameterTypeDescription
listlistThe items to test.
conditionfunctionA function of one item that answers true or false, such as each _ > 0.

Returns

logical. true when the condition holds for every item; an empty list gives true.

Examples

All prices positive

List.MatchesAll({12.5, 8, 23}, each _ > 0)
true

All codes three letters long

List.MatchesAll({"NOR", "SWE", "DK"}, each Text.Length(_) = 3)
false

DK has two letters, so the answer is false.

List.MatchesAny, List.AllTrue, Table.MatchesAllRows.

Last updated · OpenBI Studio 0.3.79