Table.ReplaceRows

语法

Table.ReplaceRows(table as table, offset as number, count as number, rows as list) as table

关于

在输入 table 中,用指定的 rows 替换指定数目的行 count,并在 offset 后开始。 rows 参数是记录列表。

  • table:要在其中执行替换的表。
  • offset:进行替换之前要跳过的行数。
  • count:要替换的行数。
  • rows:要插入到 offset 指定的位置的 table 中的行记录列表。

示例 1

从位置 1 开始,替换 3 行。

使用情况

Table.ReplaceRows(
    Table.FromRecords({
        [Column1 = 1],
        [Column1 = 2],
        [Column1 = 3],
        [Column1 = 4],
        [Column1 = 5]
    }),
    1,
    3,
    {[Column1 = 6], [Column1 = 7]}
)

输出

Table.FromRecords({
    [Column1 = 1],
    [Column1 = 6],
    [Column1 = 7],
    [Column1 = 5]
})