OpenBI Docs Buy

List.Range

A run of items from the middle of a list: from a position, a set number of them or all the rest.

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

Syntax

List.Range(list as list, offset as number, optional count as nullable number) as list
ParameterTypeDescription
listlistThe list.
offsetnumberWhere the run starts, counted from 0.
countnullable number
optional
How many items to take; to the end when left out.

Returns

list. The items of the run.

Remarks

  • A count that reaches past the end stops at the end.

Examples

March to May

List.Range({"Jan", "Feb", "Mar", "Apr", "May", "Jun"}, 2, 3)
{"Mar", "Apr", "May"}

From April on

List.Range({"Jan", "Feb", "Mar", "Apr", "May", "Jun"}, 3)
{"Apr", "May", "Jun"}

List.FirstN, List.Skip, Table.Range.

Last updated · OpenBI Studio 0.3.79