List.MatchesAny is a Power Query M function that checks if any value in a list satisfies a specified condition. The function returns true if any value meets the condition, and false otherwise.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
List.MatchesAny(
list as list,
condition as function,
) as logical
Description
Returns true
if the condition function, condition
, is satisfied by any of values in the list list
, otherwise returns false
.
Examples
Find if any of the values in the list {9, 10, 11} are greater than 10.
// Output: true
List.MatchesAny( {9, 10, 11}, each _ > 10 )
Find if any of the values in the list {1, 2, 3} are greater than 10.
// Output: false
List.MatchesAny( {1, 2, 3}, each _ > 10 )
Related articles
Learn more about List.MatchesAny in the following articles:
- Lists in Power Query M / List Functions (200+ Examples)
The complete guide to Lists in Power Query M. Learn from practical examples and master Power Query’s most powerful List functions. » Read more
Related functions
Other functions related to List.MatchesAny are: