{"id":595,"date":"2023-12-28T04:38:58","date_gmt":"2023-12-27T17:38:58","guid":{"rendered":"https:\/\/andyhowes.local\/?p=595"},"modified":"2023-12-28T04:40:24","modified_gmt":"2023-12-27T17:40:24","slug":"handling-the-power-query-formula-firewall-error","status":"publish","type":"post","link":"https:\/\/andyhowes.local\/handling-the-power-query-formula-firewall-error\/","title":{"rendered":"Handling the Formula.Firewall error"},"content":{"rendered":"\n

An issue that I’ve come across fairly regularly when using Power Query is the Formula.Firewall error:<\/p>\n\n\n\n

Formula.Firewall: Query 'query' (step 'step') references other queries or steps and so may not directly access a data source. Please rebuild this data combination.<\/code><\/pre>\n\n\n\n

Power BI returns a Formula.Firewall error when one query is making a request to another data source of a different privacy level. This error acts as a security mechanism to prevent potential data leakage from queries accessing external sources. <\/p>\n\n\n\n

For instance, if you had a table with a list of stocks, and then created a custom column that called a web API function for each stock, this would return a Formula.Firewall error. Why? Because information is being ‘leaked’ to the external source. If the API owners were nefarious, they could look at the stock ticker info being requested and use it to their advantage.<\/p>\n\n\n\n

The Formula.Firewall error is letting us know that this data leakage is occurring, and we should be aware of it.<\/p>\n\n\n\n

Of course, often we want to dynamically combining sources. If you trust the sources you are combining, then it doesn’t matter if information leaks from one to the other.<\/p>\n\n\n\n

If you don’t trust the sources, or you are concerned about data leakage you should rebuild your query to avoid leaking data in this way.<\/p>\n\n\n\n

If you are certain that this form of information leaking is okay in your context, there are a number of ways you can resolve the error:<\/p>\n\n\n\n

    \n
  1. Set the Privacy level<\/a> of all data sources to Organisationa<\/strong>l. Power Query uses privacy levels to make sure that data is only shared at the same level. It will never let you request information from a public source if that information would leak information from a private source.<\/li>\n\n\n\n
  2. Rebuild your query to avoid the error. <\/strong>Explore alternative solutions such as loading data and then merging it, rather than querying dynamically. This approach might bypass the Formula.Firewall error. This blog from Excel Guru<\/a> has some great suggestions.<\/li>\n\n\n\n
  3. Ignore Privacy Levels.<\/strong> While not recommended, you can choose to ignore privacy levels if you are confident that the leaked information is not a concern for you. To do this, go to File > Options and Settings > Options > Privacy > Always ignore Privacy Level Settings.<\/li>\n<\/ol>\n\n\n\n

    To learn more about privacy levels and the Formula.Firewall error, refer to the official Power BI documentation<\/a>.<\/p>\n\n\n\n

    There are also a number of great blogs on this subject:<\/p>\n\n\n\n

    Excel Off The Grid<\/a><\/p>\n\n\n\n

    The Power User<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

    It\u2019s an error I\u2019ve come across many times while working in Power BI. Learn what the Formula.Firewall error is, and how to fix it.<\/p>\n","protected":false},"author":1,"featured_media":600,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[7,1,8],"tags":[],"class_list":["post-595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-intelligence","category-general","category-power-platform"],"_links":{"self":[{"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/posts\/595"}],"collection":[{"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/comments?post=595"}],"version-history":[{"count":3,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/posts\/595\/revisions"}],"predecessor-version":[{"id":601,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/posts\/595\/revisions\/601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/media\/600"}],"wp:attachment":[{"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/media?parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/categories?post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andyhowes.local\/wp-json\/wp\/v2\/tags?post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}