The Excel Power Query Formula.Firewall error usually means a query is combining data sources or referencing another query in a way Power Query cannot safely evaluate under its privacy rules. Start by checking the source privacy levels, then separate source-access steps from query-reference steps; change the privacy setting that controls the combination only if you understand the data-sharing risk.
What the Formula.Firewall error means
Formula.Firewall is a Power Query error, not an error from an ordinary Excel worksheet formula. It often includes wording such as: “Query ‘…’ (step ‘…’) references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.” The exact text can vary, but the key clue is that Power Query has detected a boundary between a data source and another query or step.
Power Query uses a privacy firewall to control how data from different sources can be combined. For example, a workbook might contain confidential customer records and also retrieve a list of web addresses from a table. If the query uses those customer records to determine what it requests from the web, information could potentially be sent outside the workbook. The firewall limits combinations that could expose data in this way.
The error does not necessarily mean that the source is unavailable, that the data is corrupted, or that the query contains invalid M code. It can appear even when a combination seems harmless, because Power Query applies its rules to the query structure and the sources’ privacy settings—not just to the result the user expects.
Why query structure can trigger the firewall
Power Query divides work into sections, or partitions, when it evaluates a query. In broad terms, a partition can access a data source, or it can use results from another partition. A firewall error can occur when a query is structured so that one partition both accesses a source and references another query. This can happen even if the referenced query ultimately reads from the same workbook or database.
A common example is a query that reads a worksheet table directly and also refers to a separate query that reads a folder. Another is a query that refers to a staging query but then adds a new direct connection to a second source in later steps. The author may see one logical sequence of transformations; Power Query evaluates dependencies and source access under additional privacy rules.
References are especially relevant. In the Power Query Editor, a referenced query uses the result of an existing query as its starting point. That is useful for reusing cleaned data, but it creates a dependency. A query that mixes that dependency with direct source access may need to be reorganized into clearer stages.
How privacy levels affect data combinations
Power Query assigns privacy levels to sources to describe how data may be shared during a combination. The usual levels are:
- Public: Data that is intended to be openly accessible, such as public web information.
- Organizational: Data that can be shared within an organization but should not be treated as public.
- Private: Sensitive data that should be isolated from other sources, such as personal or confidential information.
These labels are safeguards, not encryption settings or a complete security system. Choosing a level tells Power Query how cautiously to handle combinations; it does not change who can open the workbook or replace the source’s access controls. A source marked Private can restrict combinations that would otherwise pass the firewall. If two sources truly belong to the same trusted boundary, their settings may need to reflect that—but do not lower a level just to make a refresh succeed.
Also check that a source is not being treated inconsistently. The same service can appear under different addresses or connection types, such as a file path and a web URL. Power Query may regard those as separate sources and apply privacy rules to each one.
How to diagnose the cause in Excel
Use the error details to identify the query and step named in the message. In Excel for Microsoft 365 on Windows, open the editor from Data > Get Data > Launch Power Query Editor if that command is available in your build, or open the query through Data > Queries & Connections. Select the affected query and inspect its steps in the Applied Steps pane.
- Note the query and step quoted in the error. If the message names a query that combines data, inspect that query first.
- Look for steps that access a source, such as a workbook, folder, database, or web address, and for steps that refer to another query.
- Check whether the query uses more than one source. A query can depend on multiple sources even when the combination happens indirectly through a referenced query.
- Review the privacy level and permissions for every relevant source, not just the one that appears in the first step.
- Refresh after making one change at a time. If the message changes, use the new query or step named in it to continue tracing the dependency.
For connection settings, use Data > Get Data > Data Source Settings, select the source, and review its permissions or privacy settings. The available buttons can vary by source and Excel build. If credentials are expired, fix them as a separate issue; credentials and privacy levels solve different problems.
Reliable fixes that preserve privacy
The most robust fix is usually to redesign the query so that source access and downstream transformations are clearly separated. Create a staging query for each source: let it connect to and retrieve data from that source, with only the necessary basic cleanup. Then build a separate result query that references the staging queries and performs the combination or final transformations.
For instance, if one query imports an orders table and another imports a product list, keep each source connection in its own staging query. Then create a third query that references those staged results and merges them. Avoid adding a new direct source connection inside that final query if it is already relying on other queries. This layout makes dependencies easier to understand and often resolves the partition conflict without weakening privacy protection.
- Keep one source-access path per staging query where practical.
- Move merges, appends, and other cross-source work into a downstream query that references the staging results.
- Remove unused steps and accidental references, especially ones left behind after copying or editing queries.
- Use the same appropriate privacy level for sources that genuinely share a trust boundary, rather than assigning a more permissive level by default.
- After restructuring, refresh the affected query and then refresh dependent queries to confirm the whole chain works.
Staging queries do not guarantee that every firewall error will disappear: the correct design depends on the sources, privacy levels, and query dependencies. But separating source retrieval from combination is a sound first approach because it makes the data flow explicit and retains the firewall’s protections.
When changing the privacy setting is appropriate
Excel’s Power Query options include controls for how privacy levels are applied when combining data. In Microsoft 365 for Windows, open Data > Get Data > Query Options, then look in the Privacy section under the global or current-workbook settings. The labels and exact choices can differ between Excel builds. One option may allow combining data according to each source’s privacy level; another may ignore those levels, sometimes described as a performance or Fast Combine choice.
Ignoring privacy levels can remove a firewall restriction, but it also removes a protection designed to prevent data from one source being passed to another during query evaluation. Use it only when the workbook’s sources are trusted together, the data flow is understood, and your organization’s rules permit it. It is not a universal repair or a good default for workbooks containing personal, financial, customer, or internal data.
If you use an organization-managed workbook, check with its data or IT administrator before changing a global option. A workbook-level setting may be preferable when the decision applies only to that file, but it still has security implications. On Mac, the Power Query features and available options can differ from Windows; check the Privacy or Query Options controls available in the installed Excel version rather than assuming the Windows path is identical.
Common misconceptions and related problems
A Formula.Firewall message is not the same as a sign-in failure. If a source rejects credentials, Power Query generally reports an authentication or access problem. It is also not necessarily fixed by clearing permissions: removing saved credentials can force a sign-in again, but it does not automatically correct incompatible privacy levels or a query partition that both references another query and accesses a source.
Similarly, changing a column’s data type, renaming a step, or repeatedly refreshing is unlikely to solve a structural firewall conflict by itself. Those actions may help when the actual error concerns a type conversion or a missing column, but the firewall message points to source combination and evaluation boundaries. Read the exact error text before changing unrelated steps.
Finally, not every query that combines sources is unsafe or inherently broken. Power Query is designed to combine data. The firewall is a safeguard that can require a compatible privacy configuration or a query layout that makes the data flow clear. A successful refresh after disabling the safeguard does not prove that the combination was appropriate.
Frequently Asked Questions
What causes Formula.Firewall in Excel Power Query?
It usually occurs when Power Query’s privacy rules cannot safely evaluate a query that combines sources or mixes direct source access with a reference to another query. The named query and step in the error are the best starting points for diagnosis.
How do I fix “references other queries or steps”?
Separate source retrieval from later work. Put each source connection in a staging query, then perform merges or other combinations in a downstream query that references those staged results. Check privacy levels as well.
Can I ignore privacy levels to remove the error?
Some Excel versions offer an option to ignore privacy levels, which may allow a combination to refresh. It weakens a data-isolation safeguard, so use it only when the sources are trusted together and the data flow is approved.
Does Formula.Firewall mean my Excel formula is wrong?
No. Formula.Firewall is a Power Query evaluation and privacy error, not a standard worksheet formula error. Review query dependencies, source connections, and privacy settings rather than changing cell formulas.
Why did the error start after my query used to refresh?
A changed source, privacy assignment, credential, connection path, or query dependency can alter how Power Query evaluates the combination. A change to Excel or the workbook’s settings can also expose a conflict that was not previously apparent.
Related
- Excel MIN and MAX Dates: Find the Earliest and Latest
- Excel Merge Shortcut: How to Merge Cells in Microsoft 365
- Excel Merge Shortcut: Keys, Options, and Safer Methods
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- SUMIF Not Working? Fix Excel Criteria, Ranges, and ResultsIf SUMIF is not working, check that the criteria really matches the cells in your criteria range and…
- Excel Can’t Edit Named Range? Fix Common Editing ProblemsYes—Excel can edit most named ranges. In Excel for Microsoft 365 on Windows, open Formulas > Name Manager,…
- IFERROR in Excel Not Working? Causes and Practical FixesIf IFERROR is not working in Excel, first check that the cell contains a formula that actually returns…
- Excel Too Many Arguments Error: Causes, Fixes, and ExamplesExcel’s “You’ve entered too many arguments for this function” message means a formula supplies more inputs than that…
- Excel Formula Not Calculating? Fix It Without ErrorsIf an Excel formula is not calculating and shows no error, first check whether Excel is set to…
- Excel Workbook Link Broken? How to Fix ItIf an Excel workbook link is broken, first identify whether you mean an external-workbook reference in a formula…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.