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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Pass List Query Parameter Value into Another SQL Server Stored Procedure

Hello,

 

I have a parameter in the form of a drop-down list, driven by a list query. This list query is a query that pulls values from a SQL Server stored procedure. This stored procedure runs a query that looks up a set of values and then returns those values into my Power BI drop down list parameter. This is working without issue.

 

Now I would like to take the parameter value  (called "Location") that the user selected and insert that value as a variable into another SQL Server stored procedure. When I do this, I get the following error:

 

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


I tried referencing the following article, but I'm having trouble identifying how to implement this workaround in my case: https://www.excelguru.ca/blog/2015/03/11/power-query-errors-please-rebuild-this-data-combination/

 

Here's the M I'm currently using to take my parameter value (Location) and pass that as a variable into my stored procedure as the @LOCATION variable:

let
locationp = Text.Upper(Location),
Source = Sql.Database("ServerAddress", "DatabaseName", [Query="#(lf)DECLARE @return_value int#(lf)EXEC @return_value = [dbo].[StoredProcedureName]#(lf) @LOCATION= " & "N'" & locationp & "' #(lf)SELECT 'Return Value' = @return_value#(lf)"])
in
Source


Any insight into how to get around this error is much appreciated!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

Go to File->Options and Settings-> Options->Privacy, change the setting to "Always ignore Privacy Level Settings", then save your PBIX file and re-open it, the error should go away. I test your scenario and everything works well after I change the Privacy setting.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

Go to File->Options and Settings-> Options->Privacy, change the setting to "Always ignore Privacy Level Settings", then save your PBIX file and re-open it, the error should go away. I test your scenario and everything works well after I change the Privacy setting.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Great post, this helped me address a similiar issue. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.