![1703773828_e774d10cbbb9450fc45efbe51abdf434.jpg](https://quantinsightsnetwork.com/wp-content/uploads/2023/12/1703773828_e774d10cbbb9450fc45efbe51abdf434-678x381.jpg)
Welcome back to this week’s edition of the Power BI blog series. This week, I look at how parameters created in Power Query are updated in Power BI.
I have extracted some data into Power BI:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image1.png/e774d10cbbb9450fc45efbe51abdf434.jpg)
I create a column to indicate if my students pass or fail (a hard coded 40% seems a fair pass mark!):
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image2.png/f32e5a15e2cf9c3e4d2d058458ce054d.jpg)
Pass = IF([Result] > 40, “Pass”, “Fail”)
I decide I will use a parameter to determine the pass level, and so that I may link it to an Excel workbook later, I will create the parameter in Power Query. I choose ‘Transform data’ from the Home tab, available on Data view or Report view:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image3.png/f1140ff857fc3b6f5f97a6a24f4a6fc7.jpg)
This takes me to the Power Query editor, where there is a ‘Manage Parameters’ option on the Home tab:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image4.png/72aa864d2854c6fefb1083fba0ab5792.jpg)
I choose to create a ‘New Parameter’:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image5.png/36776d1da4d05b45bb5a5d09375f407c.jpg)
I ensure that the Type is ‘Decimal Number’ (since I can’t pick whole number here), and I set the value to 50. I save the parameter and set it to load to Power BI:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image6.png/23912d3b1671861e02bebcd5183f1607.jpg)
I then ‘Close & Apply’ from the Home tab, and my parameter appears in the Fields pane:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image7.png/6f49c288a0d88a66b427eaf4ece923d6.jpg)
On the Data view, I amend the column Pass to use the parameter P_PassMark:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image8.png/b9ee28d90e6b5bc92ea4aeafdad51628.jpg)
Pass = IF([Result] > P_PassMark, “Pass”, “Fail”)
Since P_PassMark is currently set to 50, Bob now fails!
On the Home tab on the Report view or the Data view, I can ‘Edit Parameters’ from the ‘Transform Data’ dropdown:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image9.png/0485ccbc83bdeec1d741bad442a1ea5f.jpg)
I can change P_PassMark back to 40:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image10.png/daf8c4f0259ce428269c0d3d4badd32b.jpg)
I click OK, and I am prompted to commit the changes to the Power Query parameter:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image11.png/22c6daeb82d7d69ac88f878227e04b28.jpg)
I do this, but Bob has still failed!
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image12.png/a1537847463e660a31158c8032525438.jpg)
Since a Power Query parameter could be linked to an external source, I need to refresh the data to see the change. I can do this from the option to the right of ‘Transform Data’ on the Home tab:
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image13.png/917da985be13220165c8d2823e95344f.jpg)
P_PassMark has been updated, and Bob has passed!
![](https://sumproduct-4634.kxcdn.com/img/containers/main/blog-pictures/2022/pbi/217/image14.png/8c3be7af9f73d031acae69ed85a2e148.jpg)
Check back next week for more Power BI tips and tricks!
Be the first to comment