List.Skip

This function returns a list that excludes the first element of a given list. If the list is empty, an empty list will be returned. Additionally, this function has an optional parameter called countOr...

Syntax

List.Skip(list as list, optional countOrCondition as any) as list

About

This function returns a list that excludes the first element of a given list. If the list is empty, an empty list will be returned. Additionally, this function has an optional parameter called countOrCondition, which allows skipping multiple values based on specific criteria. If a number is provided, the function will skip up to that many items in the list. If a condition is specified, the returned list will start with the first element that meets the criteria. Subsequent items that do not meet the condition will be ignored. If the countOrCondition parameter is not provided, the default behavior of excluding only the first element of the list will be observed.

Explanation

Generate a new list by excluding the initial 3 elements from the set {1, 2, 3, 4, 5}. Usage: Power Query MList.Skip({1, 2, 3, 4, 5}, 3) Result: {4, 5} --- Construct a new list from {5, 4, 2, 6, 1} which commences with numbers that are less than 3. Usage: Power Query MList.Skip({5, 4, 2, 6, 1}, each _ > 3) Result: {2, 6, 1}