Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
sillyguy
New Member

Formula.Firewall error, how to fix?

I need help. I keep getting this error: 

Formula.Firewall: Query 'Query1' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

 

Here's my query:

 

 

let


Source = Sql.Database("tcp:axbyod.database.windows.net,1111", "ax_dev_demo",

[Query="exec [dbo].[getSelectedAccounts] '"& accounts &"','"& startDate &"','"& endDate &"','"& queryParam &"','"& voucher &"','"& program &"','"& programType &"','"& project &"','"& province &"','"& department &"','"& university &"'"]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Contract Year", type date}, {"Date", type date}, {"Document Date", type date}})


in


#"Changed Type"

 

 

 

3 REPLIES 3
Vijay_A_Verma
Super User
Super User

Put your entire Source into second statement. Hence, below should remove this error

let
    #"Changed Type" = Table.TransformColumnTypes(Sql.Database("tcp:axbyod.database.windows.net,1111", "ax_dev_demo",[Query="exec [dbo].[getSelectedAccounts] '"& accounts &"','"& startDate &"','"& endDate &"','"& queryParam &"','"& voucher &"','"& program &"','"& programType &"','"& project &"','"& province &"','"& department &"','"& university &"'"]),{{"Contract Year", type date}, {"Date", type date}, {"Document Date", type date}})
    in
#"Changed Type"

Thanks for your reply Vijay_A_Verma but unfortunately it didn't work.

 

It gives me a new (similar) error:


Formula.Firewall: Query 'Query1' (step 'Changed Type') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

Create a a new blank query and paste the following code inside it (Rename the query to StagingQuery). You will probably don't need to load the data in report, hence right click on this query and uncheck Enable load

 

let
    Source = Sql.Database("tcp:axbyod.database.windows.net,1111", "ax_dev_demo",
    [Query="exec [dbo].[getSelectedAccounts] '"& accounts &"','"& startDate &"','"& endDate &"','"& queryParam &"','"& voucher &"','"& program &"','"& programType &"','"& project &"','"& province &"','"& department &"','"& university &"'"])
in
    Source

 

Now, in the original query, delete everything and paste following and check whether the message disappears

 

let
    Source = StagingQuery,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Contract Year", type date}, {"Date", type date}, {"Document Date", type date}})
in
    #"Changed Type"

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.