OpenBI Docs Buy

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
ParameterTypeDescription
tabletableThe table to drop rows from.
countOrConditionany
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.Skip does.

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))
ProductSales
Chair120

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)
ProductSales
Chair120
Desk340

Table.Skip, Table.RemoveLastN, Table.FirstN, Table.PromoteHeaders.

Last updated · OpenBI Studio 0.3.79