List.Range Function in Power Query
The List.Range function returns a list contains the number of items from the list after the offset.
Syntax
List.Range(list as list, offset as number, optional count as nullable number) as list
The function has the following parameters:
- list: The list specifies the source list.
- offset: The offset specifies the items to ignore from the start of the list.
- count: The count specifies the maximum number of items in the returned list.
Example: Returns the list items after an offset.
Power Query M
let source = {"India", "America", "Canada", "Japan", "Australia", "England"}, return = List.Range(source, 2) in return
The output of the above code is shown below:
Example: Returns the list items after an offset, and also specify the maximum number of items returned in the list.
Example:
Power Query M
let source = {"India", "America", "Canada", "Japan", "Australia", "England"}, return = List.Range(source, 2, 3) in return
The output of the above code is shown below: