Forum

Formula.Firewall: Q...
 
Notifications
Clear all

Formula.Firewall: Query references other queries or steps, so it may not directly access a data source.

11 Posts
2 Users
0 Reactions
136 Views
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

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.

 
Posted : 05/12/2016 4:31 am
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 05/12/2016 7:58 pm
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

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 (((

 
Posted : 07/12/2016 6:32 am
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 08/12/2016 10:38 pm
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

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.

 
Posted : 13/12/2016 5:40 am
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 14/12/2016 4:37 am
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

Hi Mynda,

Please, find attached the spreadsheet with queries.

Oleg.

 
Posted : 14/12/2016 7:50 pm
(@mynda)
Posts: 4761
Member Admin
 

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

 
Posted : 15/12/2016 8:23 pm
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

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!

 
Posted : 24/12/2016 7:08 am
(@olegyun)
Posts: 21
Eminent Member
Topic starter
 

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?

 
Posted : 24/12/2016 7:20 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Oleg,

Great. I'm aiming for February. I'll be sure to let you know when it's ready.

Mynda

 
Posted : 28/12/2016 1:40 am
Share: