Table.Repeat

Updated on

Table.Repeat is a Power Query M function that repeats the rows in a table a specified number of times. The function returns a new table with the rows repeated according to the given count.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

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

Description

Table.Repeat repeats the rows of the tables a specified number of times. It returns a table with the rows from the input table repeated the specified count times.

Examples

Repeat the rows in the table two times.

Table.Repeat( 
    Table.FromRecords( {
        [a = 1, b = "hello"],
        [a = 3, b = "world"]
    } ),
    2
 )

 /* Output: 
Table.FromRecords( {
    [a = 1, b = "hello"],
    [a = 3, b = "world"],
    [a = 1, b = "hello"],
    [a = 3, b = "world"]
} )
 */ 

Other functions related to Table.Repeat are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/table-repeat