Table.Range

Table

Returns a specified number of rows from a table starting at a given offset.

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

Syntax

Table.Range(table as table, offset as number, optional count as nullable number) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe input table.
offsetnumberYesThe zero-based index of the first row to return.
countnumberNoThe number of rows to return. If omitted, all rows from the offset onward are returned.

Return Value

tableA table containing rows from the specified offset for the given count.

Remarks

Table.Range returns a slice of rows from a table, starting at a zero-based offset. This is like combining Table.Skip and Table.FirstN — skip to the offset, then take a specific count.

If count is omitted, all remaining rows from the offset onward are returned. If the offset plus count exceeds the number of rows, only the available rows are returned (no error is raised).

Examples

Example 1: Get rows 3 through 5

Table.SelectColumns(Table.Range(Sales, 2, 3), {"OrderID", "CustomerName", "Product"})
Result
OrderID
CustomerName
Product
13CharlieWidget C
24AliceGadget D
35DianaWidget A

Compatibility

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