Power Query normally hard-codes values such as a year or a row count into its steps. Point those steps at a cell instead, and anyone can change the cell and click Refresh All to get new results, without opening the editor.
What we're building
A sheet that fetches the highest-grossing films of any year from Box Office Mojo. Type a year and a number in two cells, click Refresh All, and the list updates.

Step 1: Build the query with fixed values
- Data → From Web, paste the page address for one year, such as
https://www.boxofficemojo.com/year/2010/, and click OK, then Connect. - In the Navigator, choose Table 0 → Transform Data.
- Select Rank, Release, Gross and Distributor (hold Ctrl), right-click → Remove Other Columns.
- Home → Keep Rows → Keep Top Rows → 15.




This works, but 2010 and 15 are now fixed inside the query.
Step 2: Turn a cell into a parameter
- Type Year in B2 and 2015 in B3. Click in it → Data → From Table/Range → OK.
- In the editor, right-click the value 2015 → Drill Down. The query now returns just the number.
- Rename the query pYear (double-click it in the Queries list).



Repeat for a Number cell (for example 7) and call it pTopN.
Step 3: Use the parameters in the main query
Right-click the main query → Advanced Editor, and replace the fixed values:
| Before | After |
|---|---|
Web.Contents("https://www.boxofficemojo.com/year/2010/") |
Web.Contents("https://www.boxofficemojo.com/year/" & Text.From(pYear) & "/") |
Table.FirstN(#"Removed Other Columns", 15) |
Table.FirstN(#"Removed Other Columns", pTopN) |


Text.From turns the number into text so it can be joined into the address. Use the step names exactly as they appear in your own query.
Step 4: Fix the privacy message
Combining a workbook cell with a web source often shows Formula.Firewall: Query … references other queries. Go to File → Options and settings → Query Options → Current Workbook → Privacy and choose Ignore the Privacy Levels.


This is fine for public web data and your own cells. For company data from several sources, set each source's privacy level instead: Data → Get Data → Data Source Settings → Edit Permissions.
Step 5: Load and use it
Load pYear and pTopN as Only Create Connection, and the main query to a sheet. Now change the year or number and click Data → Refresh All.


Things to know
- If a website changes its layout or addresses, the query breaks; check Table 0 is still the right table.
- The same method works for a file path, a date range or a region name: any value you'd otherwise type into a step.
- Power Query also has Home → Manage Parameters, but those are changed inside the editor. The cell method is easier for other people.