List.RemoveFirstN

List

Removes the first N items from a list, or items from the start while a condition is true.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

List.RemoveFirstN(list as list, countOrCondition as any) as list

Parameters

NameTypeRequiredDescription
listlistYesThe source list.
countOrConditionanyYesA number specifying how many items to remove from the start, or a condition function that removes items while it returns true.

Return Value

listA new list with the first N items removed.

Remarks

List.RemoveFirstN removes items from the beginning of a list and returns the remainder. It is functionally identical to List.Skip — the two functions behave the same way. Use whichever name makes your intent clearer in context.

When passed a number N, it removes the first N items. If N is larger than the list length, an empty list is returned. When passed a condition function, it removes items from the start while the condition returns true, stopping permanently at the first item that fails — subsequent items that would satisfy the condition are not removed.

This function does not modify the original list; it returns a new list. For removing from the end, use List.RemoveLastN. For removing a block from the middle, use List.RemoveRange. For removing items by value rather than position, use List.RemoveMatchingItems or List.Select with a negated condition.

Examples

Example 1: Remove the first 2 items

List.RemoveFirstN({1, 2, 3, 4, 5}, 2)
Result
Result
1{3, 4, 5}

Example 2: Remove items while value is less than 30

List.RemoveFirstN({10, 20, 30, 40, 50}, each _ < 30)
Result
Result
1{30, 40, 50}

Example 3: Skip header-like rows (remove first 3)

let
    Rows = {"Header", "Subtitle", "---", "Data1", "Data2", "Data3"},
    DataOnly = List.RemoveFirstN(Rows, 3)
in
    DataOnly
Applied Steps

The final output — the list with the 3 header rows stripped away, containing only the data entries.

Result
1{Data1, Data2, Data3}

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks