OpenBI Docs Buy

Table.MatchesAnyRows

Tells whether at least one row of a table meets a condition.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.MatchesAnyRows(table as table, condition as function) as logical
ParameterTypeDescription
tabletableThe rows to test.
conditionfunctionA function of a row that gives true or false, often written with each.

Returns

logical. true when the condition holds for some row; false for a table without rows.

Examples

Any line of a single unit?

Table.MatchesAnyRows(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}), each [Units] = 1)
true

Any price above 500?

Table.MatchesAnyRows(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}), each [Price] > 500)
false

Table.MatchesAllRows, Table.SelectRows, List.MatchesAny.

Last updated · OpenBI Studio 0.3.79