Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I'm trying to put a paramenter in my SQL Query so I have change the code to this.
let
Source = Sql.Database("FRV", "DW", [Query="Select *#(lf)from [dbo].[FactRetailSales] FRS#(lf)Inner Join [dbo].[DimRetailProduct] DRP on FRS.Product_ID = DRP.Product_ID#(lf)Inner Join [dbo].[DimDate] DD on FRS.Sale_Date = DD.DateKey#(lf)Where DD.Year = '" &Year_Select&"'"])
in
Source
Year_Select is my parameter.
However I am getting this error.
Formula.Firewall: Query 'Sales_Data' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
Does anyone know how I resolve the problem?
Regards
GrahamR99
Hi @GrahamR99,
The error message means there is a problem about Query 'Sales_Data', please follow the steps here to troubleshooting it. From your statement, the passed paramenter statement syntax is right. You can check how to Pass parameter to SQL Queries statement using Power BI in this vedio.
In addition, I post two similar articles for your reference.
Formula.Firewall: Query references other queries, so it may not directly access a data source.
How do I pass parameters to my SQL statement?
Best Regards,
Angelia
Hello Angelia
I have followed how to set a parameter video, I still get the same issue.
The trouble shooting page is not much help as I am querying SQL server not Excel and my parameter is in the first line of the SQL code.
Do you have any more help?
Regards
GrahamR99
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 45 | |
| 42 | |
| 28 | |
| 18 |
| User | Count |
|---|---|
| 200 | |
| 125 | |
| 102 | |
| 69 | |
| 53 |