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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
shuhn1229
Resolver I
Resolver I

Storing and reusing a value as a variable/parameter for other queries

Hi all,

 

Can someone let me know if I am approaching this problem from the right angle?

 

I have an excel sheet that contains a particular value in a specific cell that gets updated somewhat infrequently. I need to store this value as a variable and pass it to a few other independent queries that call an API, so that those APIs can fetch the right data contingent on this value. I want this all to happen automatically upon scheduled refresh so that when the result of that cell is first updated, it gets passed to the other queries so that they can pull the right data.

 

What I did was leverage the following code to create a one column list:

 

let
    Source = Excel.Workbook(Web.Contents("https://myurl.com/Token.xlsx")){[Name="myParameter"]},
    Data = Source[Data],
    Column1 = Data[Column1]
in
    Column1

 

Then I created a new parameter, selected "from query", & referenced the list generated by this query. The problem I am running into is that when I update the value in the spreadsheet, I have to manually select the new parameter in PBI desktop (edit parameters) to update that parameter, which will then flow to the other queries. Again, the idea is that when that value is updated, I store it as a variable and then patch it to all the other queries that would happen downstream of it. Am I thinking about this the right way?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can just filter the query for the Excel data to just a list, and then instead of making a proper "parameter" from the GUI, just refer directly to the query as the list parameter. So if the query with your list from Excel is named "FilterList", then your other queries can use it as a parameter like:

 

let Source = SomeTable

ApplyList = Table.SelectRows(Source, each List.Contains(List.Buffer(FilterList), [ColumnNameBeingFiltered]))

 

--Nate

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You can just filter the query for the Excel data to just a list, and then instead of making a proper "parameter" from the GUI, just refer directly to the query as the list parameter. So if the query with your list from Excel is named "FilterList", then your other queries can use it as a parameter like:

 

let Source = SomeTable

ApplyList = Table.SelectRows(Source, each List.Contains(List.Buffer(FilterList), [ColumnNameBeingFiltered]))

 

--Nate

 

 

Hi,

If I do this I get the following error: Formula.Firewall: Query ‘____’ (step ‘____’) references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

Is there anyway around this?

Thx

figured it out, ignore privacy. 

 

shuhn1229_0-1700172575531.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.