Table.Partition

Table

Partitions a table into a list of tables using a hash function on a specified column.

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

Syntax

Table.Partition(table as table, column as text, groups as number, seed as number) as list

Parameters

NameTypeRequiredDescription
tabletableYesThe table to partition.
columntextYesThe column whose values are hashed to assign rows to partitions.
groupsnumberYesThe number of partitions (output tables) to create.
seednumberYesA seed value for the hash function, affecting how rows are distributed.

Return Value

listA list of tables, where each table is a partition of the original.

Remarks

Table.Partition distributes rows from a table into a list of groups sub-tables using a hash function applied to the specified column. Each row is assigned to exactly one partition based on a hash of its column value, modulo the number of groups. Every row in the original table appears in exactly one partition — no rows are dropped or duplicated.

The seed parameter influences the hash function and changes how rows are distributed across partitions. Changing seed with the same data and groups count may yield a different distribution. Partitioning is primarily used for parallel or chunked processing — for example, processing a large table in N independent batches, or distributing work across multiple calls.

Table.Partition is the counterpart of Table.FromPartitions — use Table.FromPartitions to reassemble partitioned tables back into one. For splitting a table into sequential pages by row count, use Table.Split instead.

Examples

Example 1: Partition 8 Sales rows into 3 buckets

let
    Sales = #table(
        {"OrderID", "CustomerName", "Product", "Region"},
        {{1,"Alice","Widget A","East"},{2,"Bob","Gadget B","West"},{3,"Charlie","Widget C","East"},
         {4,"Alice","Gadget D","North"},{5,"Diana","Widget A","West"},{6,"Bob","Thingamajig E","East"},
         {7,"Charlie","Gadget B","West"},{8,"Diana","Widget C","North"}}
    ),
    Partitions = Table.Partition(Sales, "OrderID", 3, 0)
in
    List.Count(Partitions)
Result
Result
13

Example 2: Access and count rows in each partition

let
    Sales = #table(
        {"OrderID", "CustomerName"},
        {{1,"Alice"},{2,"Bob"},{3,"Charlie"},{4,"Alice"},{5,"Diana"},{6,"Bob"},{7,"Charlie"},{8,"Diana"}}
    ),
    Partitions = Table.Partition(Sales, "OrderID", 2, 0),
    Counts     = List.Transform(Partitions, Table.RowCount)
in
    Counts
Result
Result
1{4, 4}

Example 3: Process each partition independently and recombine

let
    Employees = #table(
        type table [EmployeeID = text, FullName = text, Salary = number],
        {{"E001","alice smith",55000},{"E002","BOB JONES",95000},{"E003","Charlie Brown",72000},
         {"E004","diana PRINCE",68000},{"E005","Eve Martinez",88000},{"E006","frank lee",52000}}
    ),
    Partitions = Table.Partition(Employees, "EmployeeID", 2, 0),
    Processed  = List.Transform(Partitions, each Table.AddColumn(_, "Bonus", each [Salary] * 0.10, type number)),
    Combined   = Table.Combine(Processed)
in
    Combined
Result
EmployeeID
FullName
Salary
Bonus
1E002BOB JONES95,0009,500
2E004diana PRINCE68,0006,800
3E006frank lee52,0005,200
4E001alice smith55,0005,500
5E003Charlie Brown72,0007,200
6E005Eve Martinez88,0008,800

Compatibility

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