Table.MatchesAllRows
Tells whether every 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.MatchesAllRows(table as table, condition as function) as logical
| Parameter | Type | Description |
|---|---|---|
table | table | The rows to test. |
condition | function | A function of a row that gives true or false, often written with each. |
Returns
logical. true when the condition holds for every row; true for a table without rows.
Examples
Every price positive?
Table.MatchesAllRows(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}), each [Price] > 0)
true
Every line more than one unit?
Table.MatchesAllRows(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}), each [Units] > 1)
false