Power Query Table.Combine: Step-by-Step Guide
In this article
Table.Combine in Power Query appends two or more tables into one, stacking their rows on top of each other. It is the function behind the Home > Append Queries button and is the correct tool when you have multiple tables with the same column structure, such as monthly exports or one table per region. To use it, you need at least two queries or tables whose column names match, and you call it from the formula bar or a custom column as Table.Combine({Table1, Table2}). If column names differ, the function still works but fills missing values with null, so aligning headers first is the main preparation step.
What You'll Need
- Power BI Desktop, Excel (Power Query Editor), or Analysis Services with Power Query available.
- Two or more queries or tables loaded in the Power Query Editor. They can be separate queries, tables in the same workbook, or a list of tables produced by another step.
- Column headers that match across the tables you intend to combine. If they do not match, decide whether to rename columns or accept nulls.
- Basic familiarity with the Power Query Editor and the formula bar (View > Formula Bar if it is hidden).
Step-by-Step
- Open the Power Query Editor. In Excel, select a cell in your data and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data. The editor opens with your queries listed on the left. Menu labels can differ slightly by version, device, and region.
- Confirm the tables you want to combine. Each source table should appear as its own query in the Queries pane. If you have raw files, first load each file as a query (for example, Data > Get Data > From File) so they appear as separate tables. Do not combine a query with a table that is still being edited in another window; close or apply changes first.
- Check and align column names. Select each query and compare the column headers in the preview. Table.Combine matches columns by name, not position. If one table has "Sales" and another has "Revenue", rename one so they match (right-click the column header > Rename). If a column exists in only one table, it will be kept and the other table's rows will show null in that column.
- Decide where to put the combined result. You can create a new query for the combined table, or combine directly inside an existing query. For a new query, use Home > New Source > Blank Query, then rename it in the Queries pane (right-click > Rename) to something like "CombinedSales".
- Open the formula bar and enter the function. With the blank query selected, click the formula bar (View > Formula Bar if needed) and type
= Table.Combine({SalesJan, SalesFeb, SalesMar}), replacing the query names with your own. Query names with spaces must be wrapped in#" ", for example#"Sales Jan". Press Enter. The preview updates to show the stacked rows. - Use the Append Queries button instead if you prefer the interface. Select the first query, then Home > Append Queries > Append Queries as New. Choose "Three or more tables" and add the remaining queries. This performs the same operation and writes a Table.Combine step into the query. The button is convenient but gives less control over the list of tables than the formula bar.
- Verify the result. Scroll through the preview and check row counts and column headers. Use the status bar at the bottom of the preview to see the row count. If the combined table has more rows than expected, look for duplicate queries in the list. If columns show null, confirm the column names match exactly, including capitalization and spaces.
- Rename and load the combined query. Right-click the new query and rename it. Then use Home > Close & Load (Excel) or Home > Close & Apply (Power BI) to load the result to a worksheet or the data model.
Common Mistakes
- Assuming columns match by position. Table.Combine aligns by column name. Two tables with identical layouts but different header spellings will produce extra columns full of nulls instead of a clean stack.
- Forgetting the list braces. The function expects a list of tables, so the argument must be in curly braces:
Table.Combine({Table1, Table2}). Passing a single table without braces returns an error. - Using query names with spaces without the required syntax. In M, a query name containing spaces must be written as
#"Query Name". TypingSales Jandirectly causes a syntax error. - Combining a query with itself. If you accidentally include the same query twice, every row appears twice. Check the list of tables in the formula.
- Combining tables with different data types. If one table's Amount column is text and another's is decimal, the combined column may become text or produce errors. Set data types consistently before combining.
Tips
- Use the formula bar to see exactly which step produced the combined table. You can edit the step later by clicking the gear icon next to it, or by editing the formula directly.
- If you have many tables, build the list with a query that returns a list of tables, then pass that list to Table.Combine. This avoids typing long lists by hand.
- Name your queries clearly before combining. Short, unique names without spaces make the formula easier to read and less error-prone.
- Combine before you clean. Appending raw tables and then applying transformations once is usually faster and easier to maintain than cleaning each table separately.
- Keep a column that identifies the source table if you need to trace rows back. Add it with Table.AddColumn before combining, or use the optional second argument of Table.Combine to supply column names when the tables have no headers.
Troubleshooting
- The function returns an error about a table not being found. Check the exact query name in the Queries pane. Names are case-sensitive in M, and names with spaces need
#" ". - The combined table has extra columns full of nulls. Column names do not match across tables. Rename columns so they are identical, or remove the mismatched column before combining.
- Rows are duplicated. The same query is listed more than once, or the source tables overlap. Remove duplicates from the list or filter the source tables first.
- The preview shows an error in a column. Data types conflict. Set the same type on each source column before combining, or use Table.TransformColumnTypes after combining.
- The Append Queries button is greyed out. Make sure you have selected a query, not a step, and that the query is not currently being edited in another window. In Excel, the button is on the Home tab of the Power Query Editor, not the worksheet ribbon.
- Changes do not appear after combining. Apply changes with Close & Load or Close & Apply. In Excel, also refresh the output table (Data > Refresh All) to pull in the latest data.
Frequently Asked Questions
What is the difference between Table.Combine and Table.CombineColumns?
Table.Combine appends rows from multiple tables into one table. Table.CombineColumns merges several columns within a single row into one column, such as joining first and last name. They solve different problems and are not interchangeable.
Can Table.Combine handle tables with different column orders?
Yes. It matches by column name, so the order of columns in each table does not matter. The output uses the column order of the first table in the list, and any columns unique to later tables are added at the end.
How do I combine tables from multiple files in a folder?
Use Data > Get Data > From File > From Folder, then combine the files in the dialog. Power Query generates a query that uses Table.Combine internally. You can also load each file as a separate query and combine them manually with Table.Combine.
Does Table.Combine remove duplicate rows?
No. It stacks all rows exactly as they are. To remove duplicates, add a step using Home > Remove Rows > Remove Duplicates after combining, or use Table.Distinct on the combined table.
Can I use Table.Combine with tables that have no headers?
Yes, but you must supply column names. Table.Combine accepts an optional second argument that provides a list of column names to use when the tables have no header row. Without it, the first row of each table is treated as data and columns are named generically.
Why does my combined query show fewer rows than the sum of the sources?
Check for filters or row limits applied to the source queries before combining. Table.Combine itself does not drop rows. Also confirm that every source query is included in the list and that none of them returned an error.