Forum Discussion
Formula.Firewall: Query references other queries, so it may not directly access a data source.
- 10 years ago
Ken Puls blogged about this here
http://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
I don't work much in Power Query anymore, and it seems like I find this thread every couple of years because it's the first that pops up in Google. And I think I keep having the same issue, and then I forget about it. So I am writing this reply as much for future me as anyone else.
Where I run into an issue is when I want a dynamic date range that I enter into a Parameters table in Excel. And of course I use the excellent fnGetParameter function from Ken Puls to retrieve the first and last dates. Once I break my query and get the Firewall formula, I end up here. And the workaround I have found is to simply write 2 other, separate queries whose only purpose is to retrieve the first date (and last date). Each query is a basic one that calls fnGetParameter and then drills down to the value I want. Sample code:
let
Source = fnGetParameter("BeginDate"),
#"Converted to Table" = #table(1, {{Source}}),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
Column1 = #"Changed Type"{0}[Column1]
in
Column1
Hope this helps others, as well as future me!