Table.Repeat
TableReturns a table that repeats the original table's rows a specified number of times.
Syntax
Table.Repeat(table as table, count as number) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table whose rows are repeated. |
count | number | Yes | The number of times to repeat the table's rows. |
Return Value
table — A table containing the original rows repeated count times.
Remarks
Table.Repeat returns a new table containing the original rows repeated count times in sequence. The result has Table.RowCount(table) * count rows. The original row order is preserved within each repetition: if the table has rows A, B, C and count is 3, the result is A, B, C, A, B, C, A, B, C.
Table.Repeat is useful for generating test datasets with known repeating patterns, creating round-robin schedules, or building cartesian-product-style datasets when combined with Table.AddIndexColumn. It is equivalent to Table.Combine(List.Repeat({table}, count)).
Note that Table.Repeat is not the same as repeating each individual row N times — that would require Table.AddColumn with a list expansion. Table.Repeat repeats the entire table as a block.
Examples
Example 1: Repeat the Products table to generate a multi-cycle test dataset
let
Products = #table(
{"ProductID","ProductName","Category"},
{{1,"Widget A","Widgets"},{2,"Gadget B","Gadgets"},{3,"Widget C","Widgets"}}
)
in
Table.Repeat(Products, 3)ProductID | ProductName | Category | |
|---|---|---|---|
| 1 | 1 | Widget A | Widgets |
| 2 | 2 | Gadget B | Gadgets |
| 3 | 3 | Widget C | Widgets |
| 4 | 1 | Widget A | Widgets |
| 5 | 2 | Gadget B | Gadgets |
| 6 | 3 | Widget C | Widgets |
| 7 | 1 | Widget A | Widgets |
| 8 | 2 | Gadget B | Gadgets |
| 9 | 3 | Widget C | Widgets |
Example 2: Build a repeating status cycle and add a sequence index
let
Regions = #table({"Region"},{{"East"},{"West"},{"North"}}),
Repeated = Table.Repeat(Regions, 3),
WithIndex = Table.AddIndexColumn(Repeated, "Cycle", 0, 1, type number)
in
WithIndexRegion | Cycle | |
|---|---|---|
| 1 | East | 0 |
| 2 | West | 1 |
| 3 | North | 2 |
| 4 | East | 3 |
| 5 | West | 4 |
| 6 | North | 5 |
| 7 | East | 6 |
| 8 | West | 7 |
| 9 | North | 8 |
Example 3: Confirm row count after repetition
let
Customers = #table(
{"CustomerID","Name"},
{{1,"Alice"},{2,"Bob"},{3,"Charlie"},{4,"Diana"}}
),
Repeated = Table.Repeat(Customers, 5)
in
Table.RowCount(Repeated)Result | |
|---|---|
| 1 | 20 |