Welcome to a follow-up to MSPTDA video number 9. And yes, this is video 9.5. We have to talk about Power Query's terrible formula.firewall error. If you want to follow along to see how to solve this error, you can download the same Excel file for video 9, and the PDF notes have a new note about the formula.firewall error.
If you tried to refresh, the front folder many bad tables query gets an error. Here is the problem. If I double-click and open this up, there is the formula.firewall error. If we go up to Advanced Editor, remember that this is the folder path we imported from an Excel parameter query, but that is a query result. We also have a function query down here. The problem is that the two queries might have different privacy settings.
I am going to show you two ways to solve this. One is probably not very good: we can change the privacy so that none of that matters. Or we can simply take this step, which, if we look at what it returns, simply returns a table filled with all of the files from that folder path. If we take that step and use it in a separate query, we will not get this error.
Before we do that, I am going to click Cancel. Here it is: up to File, down to Options and Settings, then Query Options. We want to go down to Privacy. If we change it to Always Ignore Privacy Settings levels, and if you want to look at the different privacy levels, there are Private, Organizational, and Public. Actually, this is a good link. If you click it, Private, Organizational, and Public describe whether data is visible to everyone, just to some people, or is private. If we say Always Ignore Privacy Settings, then when we click OK and refresh, that error will go away. There is no more conflict between two queries in their privacy levels.
Now I am going to go back up to Options, Query Options, Privacy, and Combine Data. We will set the default step and click OK. Now if we refresh, we get the error again.
Here is how we are going to fix this. Go up to Advanced Editor. That is the step we are going to simulate in a different query: Folder.Files. I am going to close and load. Remember, FolderManyBadTables was referring to a folder path input. When I double-click and open this, this was the parameter query where the first step was getting the table, and then we navigated down to get this folder path. But that folder path was calling an external data source in the other query. That is what was causing the conflict.
If we deliver the full table in this query, we are totally allowed to use this query from FolderManyBadTables. Because there is no external data call, it will not flag a formula.firewall with that privacy issue. So I am going to add a step here: fx, and the function we used was Folder.Files. By the way, that is the name of the previous step, even though it says Navigation there. Close the parentheses. When I hit Enter, I have loaded the table here, landed from the external source.
Ken Pohl's article has a great diagram that calls this a staging query. I am going to name the step over here Blended Data and press Enter. So we have landed the data, and that is the name of the query. I am going to click Close and Load, and it is connected as Connection Only.
Now I come back to this, double-click, and go up to Advanced Editor. In step one, now that I have landed the data as a separate query and used the folder path over there, if I set source equal to the output of that other query, there is no problem. Done. Because we took the query with the external folder path out of this query and used it in the folder path input to deliver the table, there is no privacy conflict.
I am going to close and load. So the formula.firewall error says that the privacy levels for two queries are in conflict. Solution one: change the Privacy Level to Always Ignore Privacy Settings, which is the setting in Power Query. Solution two: land the first query that has an external connection as Connection Only, then use that named query in the second query.
If you liked this video, be sure to click the Thumbs Up, leave a comment, and subscribe, because there are always many more videos to come from Excel Is Fun. We will see you in the next video.
