Table.ReplaceRows

Syntax

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

About

用指定的行替换指定的行数, counttable 指定 rowsoffset开始。 参数 rows 是记录列表。

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

示例 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]
})