List.AllTrue
ListReturns true if all values in the list evaluate to true.
Syntax
List.AllTrue(list as list) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
list | list | Yes | The list of logical values to evaluate. |
Return Value
logical — True if every value in the list is true (or truthy); false otherwise.
Remarks
List.AllTrue returns true if every item in the list is logically true, and false as soon as any item is false. It is designed for lists of logical (true/false) values, and is typically paired with List.Transform to first convert a list of any type into a list of conditions.
An empty list returns true — this is known as vacuous truth: there are no items that could fail the condition. Null values in the list are treated as false, so a list containing any null will return false. Non-logical values (such as numbers or text) will cause a type error; use List.Transform to coerce or evaluate values before passing them in.
Compared to List.MatchesAll, which accepts a predicate function directly, List.AllTrue requires the list to already contain logical values. The typical pattern is List.AllTrue(List.Transform(someList, each . Use List.MatchesAll when you prefer a single-step approach.
Examples
Example 3: Validate all unit prices in the Sales table are positive
let
Sales = #table(
{"OrderID", "UnitPrice"},
{{1, 25.00}, {2, 50.00}, {3, 15.00}, {4, 75.00}}
),
Prices = Sales[UnitPrice],
AllPositive = List.AllTrue(List.Transform(Prices, each _ > 0))
in
AllPositiveThe final output — transforms each price into a true/false check for being greater than zero, then confirms all results are true.
Result | |
|---|---|
| 1 | TRUE |