OpenBI Docs Buy

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
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 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

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

Last updated · OpenBI Studio 0.3.79