List.MatchesAll

List

Returns true if the condition function returns true for every item in the list.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

List.MatchesAll(list as list, condition as function) as logical

Parameters

NameTypeRequiredDescription
listlistYesThe list to test.
conditionfunctionYesA function that takes a list item and returns a logical value.

Return Value

logicalTrue if the condition returns true for all items; false if any item fails the condition.

Remarks

List.MatchesAll applies a condition (predicate) function to every item in a list and returns true only if every item satisfies the condition. It is the list equivalent of the universal quantifier — "for all items, the condition holds."

Unlike List.AllTrue, which expects a pre-built list of logical values, List.MatchesAll accepts any list and evaluates the predicate on each item inline. This makes it the more idiomatic choice when working directly with a data list: List.MatchesAll(Sales[UnitPrice], each _ > 0) is cleaner than wrapping a List.Transform call.

An empty list returns true (vacuous truth). The function short-circuits as soon as a failing item is found. For the "at least one" check, use List.MatchesAny. For simple equality membership, List.Contains and List.ContainsAll are more appropriate.

Examples

Example 1: Check if all numbers are positive

List.MatchesAll({1, 5, 3, 8}, each _ > 0)
Result
Result
1TRUE

Example 2: Check fails when one item doesn't match

List.MatchesAll({1, 5, -3, 8}, each _ > 0)
Result
Result
1FALSE

Example 3: Validate all order amounts exceed minimum

let
    OrderAmounts = {150.00, 225.50, 89.99, 310.00},
    MinOrder = 50.00,
    AllValid = List.MatchesAll(OrderAmounts, each _ >= MinOrder)
in
    AllValid
Applied Steps

The final output — checks whether every order amount in the list meets or exceeds the minimum order threshold, returning true because all values are above 50.

Result
1TRUE

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks