Table.SplitAt is a Power Query M function that returns a list containing two tables: one with the first N rows of the input table (as specified by count) and another with the remaining rows. The function returns a list of two tables.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Table.SplitAt(
table as table,
count as number,
) as list
Description
Table.SplitAt returns a list containing the first count rows specified and the remaining rows. It provides two tables: one with first N rows of table
(as per count
) and another with the remaining rows.
Examples
Return the first two rows of the table and the remaining rows of the table.
Table.SplitAt( #table( {"a", "b", "c"}, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} ), 2 )
/* Output:
{
#table( {"a", "b", "c"}, {{1, 2, 3}, {4, 5, 6}} ),
#table( {"a", "b", "c"}, {{7, 8, 9}} )
}
*/
Related functions
Other functions related to Table.SplitAt are: