Power Query: Riveting Results Part 8
2 February 2022
Welcome to our Power Query blog. This week, I create a parameter to define the location of another Excel source file.
My salespeople are working from home. This week, I continue looking at the exam results I created in Power Query: Riveting Results Part 1:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image1.png/e774d10cbbb9450fc45efbe51abdf434.jpg)
I will be grading the results, and I will be using this example to explore parameters. Last week, I amended my query to use parameters from Excel cells in the same workbook.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image2.png/f32e5a15e2cf9c3e4d2d058458ce054d.jpg)
However, I now want to store the grading bands in a separate workbook away from the exam results.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image3.png/f1140ff857fc3b6f5f97a6a24f4a6fc7.jpg)
The new bands are stored in a workbook which I have called ‘Blog 270 Exam Grade Bands’.
Back in my original workbook, I need to extract the data. I can do this by creating a new query from the ‘Get Data’ dropdown in the ‘Get & Transform’ section of the Data tab. Note that to extract data ‘From Workbook’, the Excel file I am extracting from must not be open.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image4.png/72aa864d2854c6fefb1083fba0ab5792.jpg)
In the dialog, I find the workbook I wish to use:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image5.png/36776d1da4d05b45bb5a5d09375f407c.jpg)
I can then choose to ‘Import’.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image6.png/23912d3b1671861e02bebcd5183f1607.jpg)
In the Navigator dialog, I can see the Named Cells and the ‘Parameters’ Sheet. I select Grade_9:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image7.png/6f49c288a0d88a66b427eaf4ece923d6.jpg)
I plan use to this as my base query. I opt to ‘Transform Data’:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image8.png/b9ee28d90e6b5bc92ea4aeafdad51628.jpg)
I am interested in the Source step:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image9.png/0485ccbc83bdeec1d741bad442a1ea5f.jpg)
The Source step points at the Excel file I have created. To reduce future maintenance, and to add flexibility I am going to create a base query which only includes the Source step, and then I am going to use a parameter to point to the file location. If I have a base query, then any changes I make to the Source step only need to be made once. I delete the other steps and call the query ‘Base Query’:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image10.png/daf8c4f0259ce428269c0d3d4badd32b.jpg)
I create a new Parameter from the ‘Manage Parameters’ option on the Home tab:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image11.png/22c6daeb82d7d69ac88f878227e04b28.jpg)
I call the new Parameter FilePath:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/270/image12.png/a1537847463e660a31158c8032525438.jpg)
I define the type as ‘Text’ and enter the ‘Current Value’ as the location of the external workbook that contains the grading bands.
Next time, I will use FilePath in Base Query.
Come back next time for more ways to use Power Query!