Table.Repeat

Table

Returns a table that repeats the original table's rows a specified number of times.

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

Syntax

Table.Repeat(table as table, count as number) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe table whose rows are repeated.
countnumberYesThe number of times to repeat the table's rows.

Return Value

tableA 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)
Result
ProductID
ProductName
Category
11Widget AWidgets
22Gadget BGadgets
33Widget CWidgets
41Widget AWidgets
52Gadget BGadgets
63Widget CWidgets
71Widget AWidgets
82Gadget BGadgets
93Widget CWidgets

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
    WithIndex
Result
Region
Cycle
1East0
2West1
3North2
4East3
5West4
6North5
7East6
8West7
9North8

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
Result
120

Compatibility

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