Table.RemoveRows
Takes out a run of rows at a position: one row, or a number of them.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.RemoveRows(table as table, offset as number, optional count as nullable number) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table to take rows out of. |
offset | number | The position of the first row to take out, counting from 0. |
count | nullable number optional | How many rows; 1 when left out. |
Returns
table. The rows before and after the run, in their order.
Remarks
- To drop rows at the top or the bottom,
Table.RemoveFirstNandTable.RemoveLastNsay so more plainly.
Examples
The second and third rows out
Table.RemoveRows(#table({"Order"}, {{1}, {2}, {3}, {4}, {5}}), 1, 2)
| Order |
|---|
| 1 |
| 4 |
| 5 |
Just the first row
Table.RemoveRows(#table({"Order"}, {{1}, {2}, {3}, {4}, {5}}), 0)
| Order |
|---|
| 2 |
| 3 |
| 4 |
| 5 |
Related functions
Table.Range, Table.RemoveFirstN, Table.InsertRows, Table.ReplaceRows.