Power Query
Search…
published
Powered By GitBook
Table.Split

Table.Split

Splits the specified table into a list of tables using the specified page size.
function (table as table, pageSize as number) as list

Description

Splits table into a list of tables where the first element of the list is a table containing the first pageSize rows from the source table, the next element of the list is a table containing the next pageSize rows from the source table, etc.

Category

Table.Transformation

Examples

Split a table of five records into tables with two records each.
1
let
2
Customers = Table.FromRecords({
3
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
4
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
5
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
6
[CustomerID = 4, Name = "Cristina", Phone = "232-1550"],
7
[CustomerID = 5, Name = "Anita", Phone = "530-1459"]
8
})
9
in
10
Table.Split(Customers, 2)
Copied!
{ Table.FromRecords({ [CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"] }), Table.FromRecords({ [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Cristina", Phone = "232-1550"] }), Table.FromRecords({ [CustomerID = 5, Name = "Anita", Phone = "530-1459"] }) }