List.AnyTrue

List

Returns true if any value in the list evaluates to true.

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

Syntax

List.AnyTrue(list as list) as logical

Parameters

NameTypeRequiredDescription
listlistYesThe list of logical values to evaluate.

Return Value

logicalTrue if at least one value in the list is true; false otherwise.

Remarks

List.AnyTrue returns true if at least one item in the list is logically true. It short-circuits and stops evaluating as soon as the first true value is found. An empty list returns false — there are no items that could satisfy the condition.

Null values are treated as false, so a list of only nulls returns false. Non-logical values (such as numbers or text) will cause a type error; use List.Transform to evaluate a condition on each item and produce a list of logical values first.

The typical pattern is List.AnyTrue(List.Transform(someList, each )). As a more concise alternative, List.MatchesAny accepts a list and a predicate function in one call. For simple membership checks, List.Contains is more idiomatic.

Examples

Example 1: At least one value is true

List.AnyTrue({false, false, true})
Result
Result
1TRUE

Example 2: All values are false

List.AnyTrue({false, false, false})
Result
Result
1FALSE

Example 3: Check if any order in the Sales table has a total over $200

let
    Sales = #table(
        {"CustomerName", "UnitPrice", "Quantity"},
        {{"Alice", 25.00, 4}, {"Bob", 50.00, 2}, {"Charlie", 15.00, 10}, {"Diana", 25.00, 6}}
    ),
    Totals = List.Transform(
        Table.ToRows(Sales),
        each _{1} * _{2}
    ),
    AnyLarge = List.AnyTrue(List.Transform(Totals, each _ > 200))
in
    AnyLarge
Applied Steps

The final output — checks whether any order total exceeds 200; all totals are 150 or less, so returns false.

Result
1FALSE

Compatibility

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