OpenBI Docs Buy

Table.ContainsAll

Tells whether a table has a matching row for every record of a list.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.ContainsAll(table as table, rows as list, optional equationCriteria as any) as logical
ParameterTypeDescription
tabletableThe table to search.
rowslistThe records to look for, each with the values of the columns that count.
equationCriteriaany
optional
Which columns to compare, as a name or a list of names; all of the record's fields when left out.

Returns

logical. true when every record matches some row.

Examples

Both products sold?

Table.ContainsAll(#table({"Shop", "Product", "Units"}, {{"Oslo", "Chair", 4}, {"Bergen", "Desk", 1}, {"Oslo", "Lamp", 6}, {"Bergen", "Chair", 2}}), {[Product = "Chair"], [Product = "Lamp"]})
true

One of them missing

Table.ContainsAll(#table({"Shop", "Product", "Units"}, {{"Oslo", "Chair", 4}, {"Bergen", "Desk", 1}, {"Oslo", "Lamp", 6}, {"Bergen", "Chair", 2}}), {[Product = "Chair"], [Product = "Sofa"]})
false

Table.ContainsAny, Table.Contains, List.ContainsAll.

Last updated · OpenBI Studio 0.3.79