Hi Mynda!
I've got this message in PowerQuery:
Formula.Firewall: Query 'TransatctionsLY' references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
How can I fix it?
What I did is:
1. I embedded date range filter sourced by parameters table as per your tutorial 7.01 Parameter Tables for Filtering.
It works as in your video!
2. I converted table into a function as per your tutorial "7.03 Custom Function for Dynamic File and Folder Paths".
I used a folder with 2 excel tables.
As a result I got the fx icon instead of table icon.
3. I created a query sourced by FolderPathLY table (with your fancy formula =LEFT(CELL("filename",B2),FIND("[",CELL("filename",B2),1)-1)&"SSRS LY") as per your tutorial "7.03 Custom Function for Dynamic File and Folder Paths".
Then I clicked "Add Cusom Column", entered "=TransactionsLY([FolderPathLY])", clicked "Ok" and
got that message:
Formula.Firewall: Query 'TransatctionsLY' references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
I tried to fix it by changing order of the steps but always got that message, whereas step 2 and step 3 work the same way as you demonstrated in your video until I try to use them together.
Please, advise me as to how I can fix it as I need that Dynamic Folder Path and Period Filtering using parameters in a one spreadsheet.
If there is another way to do it please let me know.
Regards,
Oleg.
Hi Oleg,
Ken Puls does a great job of explaining what's going on here and a solution in this post: http://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/
Let me know if you get stuck.
Mynda
Hi Mynda,
I tried but unfortunately I haven't managed to apply that approach in my case.
My case is quite different as I take data from a folder and then I need to convert table into function as demonstrated in your video.
I understood the approach Ken Puls showed but I can't apply it to my case. (((
You know how it happens, you seemingly understand theory but then are not able to apply that in practice.
This is my case now.
So, I've got stuck (((
Hi Oleg,
I can't test your file because you didn't include the files from the folder, but try this:
1. Remove the last step (#Filtered Rows) from your TransactionsLY query.
2. Create a new blank query that references the FolderPathLY query and add the filter step to this new query. It should look like this:
let Source = FolderPathLY, #"Filtered Rows" = Table.SelectRows(Source, each [Transaction Date] >= pmtStartDate and [Transaction Date] <= pmtEndDate) in #"Filtered Rows"
Let me know how you get on.
Mynda
Hi Mynda,
thank you so much, it works now!!!
You even can't imagine how you have helped me.
I am so happy now!!!)))
Can you please explain me as to why you add this row after filtering dates with parameters:
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each true),
I tried the query without that fragment and it is not working.
Once again, thank you Mynda!
Oleg.
Hi Oleg,
I'm glad it's working now 🙂
I didn't add a step called #"Filtered Rows1" and if you removed it then you need to also change the subsequent steps as they'll be trying to reference that step.
Do you want to share your file again and I can take a look?
Mynda
Hi Mynda,
Please, find attached the spreadsheet with queries.
Oleg.
Hi Oleg,
If you change your M code for TransactionLY query in the advanced editor to this:
let
Source = TransactionPathLY,
#"Filtered Rows" = Table.SelectRows(Source, each [Transaction Date] >= pmtStartDate and [Transaction Date] <= pmtEndDate),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Policy Number", "Transaction Date", "Currency Code", "Policy Net Count", "Sales Premium", "Sales Premium Discount", "Underwriter Gross", "GPAD", "Underwriter Name"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Policy Number", type text}, {"Currency Code", type text}, {"Transaction Date", type date}, {"Policy Net Count", Int64.Type}, {"Sales Premium", type number}, {"Sales Premium Discount", type number}, {"Underwriter Gross", type number}, {"GPAD", type number}, {"Underwriter Name", type text}})
in
#"Changed Type"
Does it work?
Mynda
Hi Mynda,
I tested the query above and it works!
So, I even do not know why that fragment came up in my query.
Once again, thank you Mynda so much!
By the way,
I am very excited with the last newsletter I received on Wednesday.
I look forward to purchasing your Power BI course.
When are you going to make the course available for purchasing?
Hi Oleg,
Great. I'm aiming for February. I'll be sure to let you know when it's ready.
Mynda