List.ContainsAll

List

Returns true if a list contains all of the values in another list.

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

Syntax

List.ContainsAll(list as list, values as list, optional equationCriteria as any) as logical

Parameters

NameTypeRequiredDescription
listlistYesThe list to search.
valueslistYesThe list of values that must all be present.
equationCriteriaanyNoA comparer function for custom equality testing.

Return Value

logicaltrue if every value from the second list is found in the first list.

Remarks

List.ContainsAll returns true only if every value in the second list appears in the first list. A single missing value causes it to return false. For a looser check that requires just one match, use List.ContainsAny.

The optional equationCriteria parameter accepts a comparer (such as Comparer.OrdinalIgnoreCase) for case-insensitive or culture-sensitive comparisons.

Examples

Example 1: Verify all required columns are present

Check whether a table has all of the columns needed for a downstream transformation.

let
    RequiredColumns = {"OrderID", "CustomerID", "Amount", "Region"},
    ActualColumns   = Table.ColumnNames(Sales),
    AllPresent      = List.ContainsAll(ActualColumns, RequiredColumns)
in
    #table({"AllColumnsPresent"}, {{AllPresent}})
Applied Steps

The final output — wraps the logical result in a single-row table labeled AllColumnsPresent.

AllColumnsPresent
1TRUE

Example 2: Check for missing values

When not all values are present, the function returns false.

let
    Source    = {"a", "b", "c"},
    CheckList = {"a", "b", "d"},
    Result    = List.ContainsAll(Source, CheckList)
in
    Result
Applied Steps

The final output — returns false because "d" from CheckList is not found in Source.

Result
1FALSE

Compatibility

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