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
| Parameter | Type | Description |
|---|---|---|
table | table | The table to search. |
rows | list | The records to look for, each with the values of the columns that count. |
equationCriteria | any 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