Table.ReplaceRows

Substitutes a designated quantity of rows, known as count, in the input table with the provided rows, starting after the offset. The rows parameter consists of a collection of records. table: The tabl...

Syntax

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

About

Substitutes a designated quantity of rows, known as count, in the input table with the provided rows, starting after the offset. The rows parameter consists of a collection of records. table: The table in which the substitution takes place. offset: The number of rows to bypass before executing the replacement. count: The number of rows to substitute. rows: The set of row records to add into the table at the position indicated by the offset.

Explanation

Commencing at the initial position, replace three rows. Usage: Power Query MTable.ReplaceRows( Table.FromRecords({ [Column1 = 1], [Column1 = 2], [Column1 = 3], [Column1 = 4], [Column1 = 5] }), 1, 3, {[Column1 = 6], [Column1 = 7]} ) Output: Table.FromRecords({ [Column1 = 1], [Column1 = 6], [Column1 = 7], [Column1 = 5] })