Downloads
Power Query MList: summarizeIntermediate

List.AllTrue

Returns true only if every item in a list of logical values is true.

Syntax
List.AllTrue(list)

Returns: A logical value, true or false.

What it does

List.AllTrue answers "do all of the items pass?" It returns true only when every item in a list of true and false results is true. Use it as a pass or fail gate: if one item fails, the whole check fails.

Syntax and arguments

Example

Every invoice in a batch must carry a valid tax code before the batch is posted. The check should pass only if all of them do.

let
    TaxCodes = {"STD", "EXEMPT", "STD", "ZERO"},
    ValidCodes = {"STD", "EXEMPT", "ZERO"},
    AllValid = List.AllTrue(List.Transform(TaxCodes, each List.Contains(ValidCodes, _)))
in
    AllValid

Every code in the list is in the valid set, so AllValid is true and the batch can move on. If one code were misspelled, the result would be false.

Example: a second, different use

Checking that every month in a 12-month schedule has a positive amount, before the schedule is loaded to the planning model.

Things to watch

In business terms

Completeness and validity gates in data loads, pre-posting checks and reconciliation pass or fail flags use this pattern. An auditor can read the rule and see exactly what must hold.

Related functions

All Power Query M functions · View as Markdown · M basics