Table.MatchesAnyRows
This function determines if there are any rows in the table that meet the specified condition. It will return true if at least one row matches the condition, and false if no rows match.
This function determines if there are any rows in the table that meet the specified condition. It will return true if at least one row matches the condition, and false if no rows match.
Example 1
Check if any values in column [a] of the table ({[a = 2, b = 4], [a = 6, b = 8]}) are even.
Power Query M Usage:
MTable.MatchesAnyRows(
Table.FromRecords({
[a = 1, b = 4],
[a = 3, b = 8]
}),
each Number.Mod([a], 2) = 0
)
Output: false
Example 2
Check if any values in the table ({[a = 1, b = 2], [a = 3, b = 4]}) match [a = 1, b = 2].
Power Query M Usage:
MTable.MatchesAnyRows(
Table.FromRecords({
[a = 1, b = 2],
[a = -3, b = 4]
}),
each _ = [a = 1, b = 2]
)
Output: true