Table.ContainsAll

语法

Table.ContainsAll(table as table, rows as list, optional equationCriteria as any) as logical

关于

指示记录列表 rows 中的所有指定记录是否在 table 中显示为行。 可以指定一个可选参数 equationCriteria 以控制表中各行之间的比较。

示例 1

确定表是否包含所有行,同时只比较列 [CustomerID]。

使用情况

Table.ContainsAll(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
        [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
    }),
    {
        [CustomerID = 1, Name = "Bill"],
        [CustomerID = 2, Name = "Fred"]
    },
    "CustomerID"
)

输出

true

示例 2

确定表是否包含所有行。

使用情况

Table.ContainsAll(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
        [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
    }),
    {
        [CustomerID = 1, Name = "Bill"],
        [CustomerID = 2, Name = "Fred"]
    }
)

输出

false

公式条件