OpenBI Docs Buy

List.RemoveRange

A list without a run of items: from a position, one item or a set number of them.

Group: List. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

List.RemoveRange(list as list, index as number, optional count as nullable number) as list
ParameterTypeDescription
listlistThe list.
indexnumberWhere the run starts, counted from 0.
countnullable number
optional
How many items to remove; 1 when left out.

Returns

list. The items before and after the run.

Examples

Without February and March

List.RemoveRange({"Jan", "Feb", "Mar", "Apr"}, 1, 2)
{"Jan", "Apr"}

One item

List.RemoveRange({"Jan", "Feb", "Mar", "Apr"}, 3)
{"Jan", "Feb", "Mar"}

List.InsertRange, List.Range, List.RemoveItems.

Last updated · OpenBI Studio 0.3.79