Power Query: Riveting Results Part 9
9 February 2022
Welcome to our Power Query blog. This week, I create parameters from another Excel file.
My salespeople are retraining. 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/271/image1.png/e774d10cbbb9450fc45efbe51abdf434.jpg)
I will be grading the results, and I will be using this example to explore parameters. Last week, I created a query as a building block for parameters extracted from another workbook, which I called ‘Base Query’.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image2.png/f32e5a15e2cf9c3e4d2d058458ce054d.jpg)
I also created a FilePath parameter to store the location of the other workbook:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image3.png/f1140ff857fc3b6f5f97a6a24f4a6fc7.jpg)
Having created the FilePath parameter, I return Base Query. For me, the M code for the Source step is:
= Excel.Workbook(File.Contents("C:\Users\kathr\OneDrive\Documents\SUMPRODUCT\PQ Blog\Blog 270 Exam Grade Bands.xlsm"), null, true)
I am going to replace the path with the FilePath parameter:
= Excel.Workbook(File.Contents(FilePath), null, true)
This is easier to read, and now I can change the path by changing the FilePath parameter.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image4.png/72aa864d2854c6fefb1083fba0ab5792.jpg)
I can now select Base Query in the Queries panel and right-click to create reference queries which will become the new grade band Parameters:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image5.png/36776d1da4d05b45bb5a5d09375f407c.jpg)
I rename the first new query EDP_Grade_9. The Source step points to Base Query. I can click on the ‘Table’ text next to Grade_9 to expand the data for that row:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image6.png/23912d3b1671861e02bebcd5183f1607.jpg)
This gives me the data for Grade_9 from the workbook, and I can right-click and drill down to the value:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image7.png/6f49c288a0d88a66b427eaf4ece923d6.jpg)
This gives me the first parameter:
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image8.png/b9ee28d90e6b5bc92ea4aeafdad51628.jpg)
I can then make more references of Base Query and repeat this process to get the other ‘EDP_Grade_’ parameters.
![](http://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/power-query/271/image9.png/0485ccbc83bdeec1d741bad442a1ea5f.jpg)
Next time, I will go back to the Exam Results query and use these parameters.
Come back next time for more ways to use Power Query!