List.ContainsAll is a Power Query M function that checks if a given list includes all the values from another list, with optional equation criteria for equality testing. The function returns true if all values are found in the list and false otherwise.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
List.ContainsAll(
list as list,
values as list,
optional equationCriteria as any,
) as logical
Description
Indicates whether the list list
includes all the values in another list, values
.
Returns true if value is found in the list, false otherwise. An optional equation criteria value, equationCriteria
, can be specified to control equality testing.
Examples
Find out if the list {1, 2, 3, 4, 5} contains 3 and 4.
// Output: true
List.ContainsAll( {1, 2, 3, 4, 5}, {3, 4} )
Find out if the list {1, 2, 3, 4, 5} contains 5 and 6.
// Output: false
List.ContainsAll( {1, 2, 3, 4, 5}, {5, 6} )
Related articles
Learn more about List.ContainsAll in the following articles:
- Lists in Power Query M / List Functions (200+ Examples)
The complete guide to Lists in Power Query M. Learn from practical examples and master Power Query’s most powerful List functions. » Read more
Related functions
Other functions related to List.ContainsAll are:
