Table.RemoveFirstN
Drops rows from the top: a number of them, or as long as a condition holds.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.RemoveFirstN(table as table, optional countOrCondition as any) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table to drop rows from. |
countOrCondition | any optional | How many rows to drop (1 when left out), or a condition: rows are dropped while it holds. |
Returns
table. The rows that are left, in their order.
Remarks
- With a condition, dropping stops at the first row that fails it; the rows after that stay, whatever they hold.
- It does what
Table.Skipdoes.
Examples
A title line above the header
let
Raw = #table({"Column1", "Column2"}, {{"Sales report, March 2026", null}, {"Product", "Sales"}, {"Chair", 120}})
in
Table.PromoteHeaders(Table.RemoveFirstN(Raw, 1))
| Product | Sales |
|---|---|
| Chair | 120 |
Blank rows at the top
let
Raw = #table({"Product", "Sales"}, {{null, null}, {null, null}, {"Chair", 120}, {"Desk", 340}})
in
Table.RemoveFirstN(Raw, each [Product] = null)
| Product | Sales |
|---|---|
| Chair | 120 |
| Desk | 340 |
Related functions
Table.Skip, Table.RemoveLastN, Table.FirstN, Table.PromoteHeaders.