Sub topic 2
Connection-only queries and where results are loaded
This chapter assumes you can load data from an Excel table into the Power Query Editor, you know what a query and an applied step are, and you have a rough idea of what appending and merging do. Later chapters combine queries. First you need to decide where each query's output goes.
Three places a query can send its result
When you choose Close & Load To... in the Power Query Editor, Excel asks how to load the result. The dialog offers these options:
| Option | What it does | Typical use |
|---|---|---|
| Table | Writes the rows to a worksheet table | Final results you want to read or chart |
| Only Create Connection | Saves the query but loads no data | Source or helper queries |
| Add this data to the Data Model | Loads the rows into the workbook's Data Model | Large data, PivotTables, relationships |
The Table and Data Model options can be combined. Only Create Connection is the choice that loads nothing.
What "connection only" means
A connection-only query still exists and still runs. Excel just does not write its rows anywhere. Other queries can use it as a source, and Excel evaluates it whenever one of those queries refreshes.
This matters for append and merge. Suppose you want to append Sales_2023 and Sales_2024. You need both as queries. If you load both to worksheets, you store the same rows twice, once in each sheet and again in the combined result. Making them connection-only avoids the duplicate copies.
Setting the load option
You can set the option in two places.
- In the Power Query Editor, open Home > Close & Load > Close & Load To... and choose Only Create Connection.
- In Excel, open the Queries & Connections pane. Right-click a query and choose Load To....
The pane also shows each query's status. A connection-only query shows "Connection only". A loaded query shows its row count.
A worked example
You have three queries: Orders, Customers, and a final query OrdersWithCustomers that merges them.
- Load
OrdersandCustomerswith Only Create Connection. - Build the merge in a new query,
OrdersWithCustomers. - Load
OrdersWithCustomersto a table.
Now the workbook holds one table of data, not three. If Customers changes, refreshing OrdersWithCustomers re-reads it and updates the result.
The source queries do not have to be connection-only to be used in a merge. You can load them to sheets as well, which helps if you want to inspect them. The cost is more stored data and a slower workbook.
Common errors
- Duplicate copies of data. Loading every intermediate query to a sheet inflates file size. Set helper queries to connection-only.
- Changing a source query and forgetting the dependents. Editing
Customerschanges everything built on it. Check the Query Dependencies view (View > Query Dependencies in the editor) before you rename columns or remove steps. - Reloading the wrong query. Refreshing a connection-only query does nothing visible. Refresh the final loaded query, or use Data > Refresh All.
- Data Model by accident. Ticking the Data Model box when you only wanted a sheet table means the rows live in the model and the worksheet shows a PivotTable-style connection instead of rows.
Exercise
You append Sales_2023 and Sales_2024 into Sales_All. You only want to see Sales_All in a worksheet. How should you load the two source queries, and why?
Show answer
Load both as Only Create Connection. Sales_All can still read them, and the workbook stores the rows once, in the final table, instead of three times.