“This query contains a reference to another query”: Handling dependency breaks.

This notification appears when Power Query encounters a break in its dependency chain, such as a deleted upstream query, a circular calculation loop, an asynchronous load collision, or a Data Privacy firewall block between connected queries.

Quick Answer

Ensure the upstream (referenced) query exists and loads sequentially. Set staging queries to “Enable Load = False” so only the final consolidated output writes to Excel. If the dependency warning coincides with a privacy error, open Data Source Settings and align privacy levels (e.g., Organizational) across all combined sources.


How Query Referencing Works and Where It Breaks

Power Query enables modular design through Referencing. Right-clicking Query A and choosing Reference generates Query B, whose starting step is simply Source = QueryA.

[Raw_ERP_Extract] (Staging Query - Load Disabled)
       │
       ├──► [Clean_Orders] (Transformed View)
       │           │
       │           └──► [Final_Financial_Report] (Loaded to Data Model)
       │
       └──► [Audit_Exceptions] (Loaded to Worksheet)

This design keeps M-code maintainable. However, because downstream queries rely on the memory buffer of upstream queries, four common issues can cause dependency failures:

  1. Name Changes or Deletions: The parent query was renamed or deleted, leaving the child referencing a null identifier.
  2. Circular References: Query A references Query B, while Query B (or an intermediate query) points back to Query A.
  3. Background Execution Clashes: Excel attempts to populate a downstream worksheet table while the upstream query is still refreshing in a separate background thread.
  4. Data Privacy Firewalls: An upstream query pulling private network data is referenced by a downstream query attempting to merge with an external web or cloud source.

Step-by-Step Dependency Diagnostics

1. Trace the Dependency Tree in the Query Dependencies View

Before altering M-code, visualize the entire processing chain:

  1. Open the Power Query Editor.
  2. Go to the View tab on the Ribbon.
  3. Click Query Dependencies.
[SQL_Customer_DB] ──► [Clean_Customers] ┐
                                          ├──► [Consolidated_Summary]
[SharePoint_Orders] ─► [Filter_Orders]   ┘

The map displays source connections on the left and downstream destinations on the right. Trace lines connecting to the failing query:

  • Look for isolated queries displaying error flags.
  • Check for loops where directional arrows feed back into an earlier node.
  • Identify whether disconnected references exist.
2. Re-link Broken Parent Names in M-Code

If a parent query was renamed from Extract_Sales to Extract_Sales_2026, any downstream query containing Source = Extract_Sales will break.

  1. Select the failing child query in the left navigation pane.
  2. Select the Source step under Applied Steps.
  3. In the Formula Bar, verify the identifier inside the formula: = SourceQueryName
  4. If the query name contains spaces or special characters, verify the hash-quote syntax: = #"Source Query Name"
  5. Update the name to match the parent query’s current title and press Enter.
3. Resolve Circular References

A circular reference cannot be evaluated because no starting point exists.

  • The Fix: If Query B requires data from Query A, but Query A needs summary calculations from Query B, split the logic. Create a standalone baseline query (Query 0) that extracts the source data without transformations. Have both Query A and Query B reference Query 0 independently.
4. Stop Simultaneous Background Load Collisions

When multiple dependent tables are set to load onto worksheet grids with Background Refresh active, Excel refreshes connections concurrently. If the downstream table finishes its initial build before the upstream staging table completes, the child table loads empty or corrupt rows.

  1. In Excel, go to the Data tab and click Queries & Connections.
  2. For each staging or upstream query, right-click and uncheck Enable Load. Staging transformations should run in memory, not output to the worksheet.
  3. For remaining queries that must write to sheets, right-click each in the pane, select Properties, switch to the Usage tab, and uncheck Enable background refresh.

This forces Excel to execute updates sequentially: Staging first, transforms second, reporting tables last. For managing multi-query execution priorities, see Using the “Refresh All” button vs. Individual Query Refresh: Conflict resolution.


The Hidden Cause: Data Privacy Firewalls

When a query references an external data source and then merges with a second source (e.g., an internal SQL query referenced and merged with an Excel budget sheet), the Power Query Firewall blocks execution to prevent data from one source leaking into the other.

If the dependency break triggers an error mentioning Formula.Firewall, you must adjust evaluation privacy settings. For the repair procedure, see Formula.Firewall: Data privacy settings prevent combining sources.