Table.Combine
Puts the rows of several tables one after the other in a single table.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.Combine(tables as list, optional columns as any) as table
| Parameter | Type | Description |
|---|---|---|
tables | list | The tables, in the order their rows should come. |
columns | any optional | The result's columns, as a list of names or a table type; every column of every table when left out. |
Returns
table. All the rows; a column some tables lack is null in their rows.
Remarks
- Columns are matched by name, not by position.
- This is the step Append queries writes in Transform data.
Examples
Two shops' sales
let
Oslo = #table({"Shop", "Units"}, {{"Oslo", 4}, {"Oslo", 6}}),
Bergen = #table({"Shop", "Units"}, {{"Bergen", 1}})
in
Table.Combine({Oslo, Bergen})
| Shop | Units |
|---|---|
| Oslo | 4 |
| Oslo | 6 |
| Bergen | 1 |
Columns that differ
let
January = #table({"Product", "Units"}, {{"Chair", 4}}),
February = #table({"Product", "Units", "Discount"}, {{"Desk", 1, 0.1}})
in
Table.Combine({January, February})
| Product | Units | Discount |
|---|---|---|
| Chair | 4 | null |
| Desk | 1 | 0.1 |
Only the columns you name
let
January = #table({"Product", "Units"}, {{"Chair", 4}}),
February = #table({"Product", "Units", "Discount"}, {{"Desk", 1, 0.1}})
in
Table.Combine({January, February}, {"Product", "Units"})
| Product | Units |
|---|---|
| Chair | 4 |
| Desk | 1 |
Related functions
Table.InsertRows, Table.Join, Table.NestedJoin, List.Combine.