Table.Range
TableReturns a specified number of rows from a table starting at a given offset.
Syntax
Table.Range(table as table, offset as number, optional count as nullable number) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The input table. |
offset | number | Yes | The zero-based index of the first row to return. |
count | number | No | The number of rows to return. If omitted, all rows from the offset onward are returned. |
Return Value
table — A 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 | |
|---|---|---|---|
| 1 | 3 | Charlie | Widget C |
| 2 | 4 | Alice | Gadget D |
| 3 | 5 | Diana | Widget A |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks