Imagine you have two or more lists in Excel and need a single table containing every possible combination. Perhaps you need all general ledger and cost center combinations, or every size and color combination for a product.
It sounds simple, right? Surely there is a button that will generate the whole list for us.
With Power Query, we need to get a little more involved, but we can achieve the result with just a few steps. There are two useful approaches: merging tables using a temporary common key, or adding entire tables as custom columns and expanding them.
The second method is easier once you understand how tables work inside Power Query. However, both are worth knowing because they teach us different ways to combine data.
What You'll Learn
- Load each source list into Power Query as a connection before creating the combinations.
- A constant key lets every row match across tables when merging queries.
- Custom columns can reference entire queries, creating nested tables ready to expand.
- Multiply source row counts to calculate the number of combinations before generating them.
The Example: Products, Sizes, and Colors
Our starting point is three Excel tables:
- Product: Budget, Standard, and Premium.
- Size: Small, Medium, and Large.
- Color: Three color options.
The goal is to create one table with Product, Size, and Color columns, containing every possible combination of the three lists.
For example, Budget needs a row for each color in Small, each color in Medium, and each color in Large. We then need the same combinations for Standard and Premium.
With three items in each list, the finished result contains 3 × 3 × 3 = 27 rows.
You can follow along with your own tables or download the example file.
Load the Source Tables into Power Query
Both solutions start with the same preparation: load each source table into Power Query as a connection.
- Select any cell in the Product table.
- Click Data > From Table/Range to open the Power Query Editor.
- If the list contains repeated values and you want unique combinations, right-click the column header and select Remove Duplicates.
- From the Home tab, open the Close & Load dropdown and select Close & Load To.
- Select Only Create Connection, then click OK.
- Repeat the process for the Size and Color tables.
The example lists already contain unique records, so there is no need to remove duplicates from them.
Once loaded, the queries appear in Excel’s Queries & Connections pane. If that pane is not visible, select Data > Queries & Connections.
For the instructions below, the three source queries are named Product, Size, and Color.
Method 1: Merge Tables Using a Temporary Common Key
The first solution uses Power Query’s merge feature. A merge needs columns to match between tables, but our three lists do not have a natural common key.
So, we create one. By putting the same value in every row of each table, every product can match every size and every color.
1. Add a Temp Column to Each Query
Reopen the Power Query Editor by opening a query from the Queries & Connections pane, or select Data > Get Data > Launch Power Query Editor.
- Select the Product query.
- Click Add Column > Custom Column.
- Enter Temp as the new column name.
- Enter 1 as the custom column formula.
- Click OK.
The new Temp column contains 1 in every row. Repeat these steps for the Size and Color queries.
The name Temp and the value 1 are simply convenient choices. For this approach, use the same name and value throughout all three tables.
2. Merge Product and Size as a New Query
- On the Home tab, open the Merge Queries dropdown.
- Select Merge Queries as New.
- Choose Product as the first table and Size as the second table.
- Select the Temp column in each preview.
- Set Join Kind to Full Outer (all rows from both).
- Click OK.
This creates a new merged query. The Size column initially displays Table rather than individual size values.
That is expected. Each product row now contains a nested table of matching sizes. Because every Temp value is 1, each product matches all three sizes. Budget has Small, Medium, and Large inside its nested table, and so do Standard and Premium.
The shared constant key is what makes every row match every other row. Full Outer is the join option used here to include all rows from both tables.
If you click a Table value to inspect its contents, Power Query adds a Navigation step. Delete that step from Applied Steps to return to the merged result before continuing.
3. Merge in the Color Table
With the new merged query selected:
- Click Home > Merge Queries. This time, use the regular Merge Queries option, not Merge Queries as New.
- Leave the current merged query as the first table.
- Select Color as the second table.
- Select the Temp column in both previews.
- Choose Full Outer (all rows from both).
- Click OK.
The query now contains the product values, the temporary key, and nested table columns for both sizes and colors.
4. Expand the Size and Color Columns
Now we turn those nested tables into rows.
- Click the expand icon in the Size table column header.
- Keep the size field selected, but clear Temp.
- Clear Use original column name as prefix.
- Click OK.
There is now a Small, Medium, and Large row for every product, giving us nine product and size combinations.
Repeat the expansion for the Color table column. Keep only the color field selected, leave the prefix option unchecked, and click OK.
Each of the nine product and size combinations now has three color rows. That gives us all 27 combinations.
5. Tidy Up and Load the Result
- Select the remaining Temp column and press Delete.
- Rename the output columns to Product, Size, and Color as needed. Power Query may have added a suffix to avoid a naming conflict during expansion.
- Select Home > Close & Load > Close & Load To.
- Choose Table and New worksheet, then click OK.
We now have a single Excel table containing every possible combination from the three source lists.
Method 2: Add Tables as Custom Columns
The second solution produces the same result without temporary keys or merge dialogs.
The useful idea here is that a custom column can contain an entire table. We can attach the Size table and Color table to every product row, then expand them just as we did in the first method.
Start again with the original Product, Size, and Color queries loaded as connections, without the Temp columns added for Method 1.
1. Create a Blank Query Referencing Product
- In Excel, select Data > Get Data > From Other Sources > Blank Query.
- In the Power Query Editor, enable View > Formula Bar if necessary.
- Enter = Product in the formula bar and press Enter.
This brings the Product query’s table into the new query. Use the query name shown in your own Queries pane if it differs from Product.
2. Add the Size Table as a Custom Column
- Select Add Column > Custom Column.
- Name the new column Size.
- Enter Size as the formula, referencing the existing Size query.
- Click OK.
Reference the query itself, not a text value. Each row of the new column should display Table, because it contains the complete Size table.
3. Add the Color Table as Another Custom Column
Repeat the same process:
- Select Add Column > Custom Column.
- Name the column Color.
- Enter Color as the formula, referencing the Color query.
- Click OK.
We now have one row per product, with a complete Size table and a complete Color table attached to each row.
4. Expand Both Tables
- Click the expand icon in the Size column header.
- Keep the size field selected and clear Use original column name as prefix.
- Click OK.
- Repeat the process for the Color column.
Expanding Size repeats each product for every size. Expanding Color then repeats each product and size combination for every color.
There are no temporary columns to remove. Rename the resulting columns to Product, Size, and Color if necessary, and set their data types to Text for this example.
5. Load the Combinations into Excel
Select Home > Close & Load > Close & Load To, then choose Table and New worksheet.
That is it. We have the same 27 combinations as before, but with fewer preparation steps.
Which Method Should You Use?
If you are comfortable with merging queries, the temporary key method provides a familiar route. It also makes the matching process clear: every row has the same key, so every row matches.
The custom column method is simpler once you are comfortable with table values in Power Query. It avoids modifying all the source queries and goes straight to the nested tables we need.
Both methods rely on the same final action: expanding tables to generate the combinations. For additional lists, the same pattern continues by bringing in another table and expanding its values.
A Warning: The Number of Combinations Grows Quickly
Before using either method on large lists, check how many rows the result will contain. The calculation is simple multiplication:
- Three lists with three rows each: 3 × 3 × 3 = 27 combinations.
- Two lists with 1,000 rows each: 1,000 × 1,000 = 1,000,000 combinations.
A few small source tables can therefore generate a very large result. Multiply the row counts of your lists before building the query so you know what to expect.
Creating all possible combinations may not be a single-click operation, but Power Query gives us two straightforward ways to get there. Use a common key and merge, or add tables directly as custom columns, then expand them into the complete list.


