Table.ContainsAny
Tells whether a table has a matching row for at least one 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.ContainsAny(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 some record matches some row.
Examples
A sofa or a lamp?
Table.ContainsAny(#table({"Shop", "Product", "Units"}, {{"Oslo", "Chair", 4}, {"Bergen", "Desk", 1}, {"Oslo", "Lamp", 6}, {"Bergen", "Chair", 2}}), {[Product = "Sofa"], [Product = "Lamp"]})
true
Neither
Table.ContainsAny(#table({"Shop", "Product", "Units"}, {{"Oslo", "Chair", 4}, {"Bergen", "Desk", 1}, {"Oslo", "Lamp", 6}, {"Bergen", "Chair", 2}}), {[Product = "Sofa"], [Product = "Rug"]})
false