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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
akaichi
New Member

Change Query Parameter Value Using DAX

Is it possible to manipualte, or change the query parameter value using buttons, slicer, and DAX?

 

Screenshot 2024-08-28 212712.png

1 REPLY 1
shafiz_p
Super User
Super User

Hi @akaichi  As I can understand that you want to change power query parameter value dynamically using slicer or buttons.

If this is the case, then you can change power query parameter value dynamically using slicer for direct query only. For import mode this is not possible.

To acheive this, follow below steps:
1. Connectivity mode should be Direct query.

shafiz_p_0-1724856512015.png

 

2. Create new parameter. For my case it is a country name list with a default value.

shafiz_p_1-1724856603594.png

 

3. Go to the table you want to filter. For my case Country name. I have used adventure works database. Open advance editor and add a filter step with parameter name. So, [EnglishCountryName] = newly created parameter name.

shafiz_p_2-1724856823838.png

 

4. Create a seperate query with the country name only column. Which will be used in the slicer to dynamically change parameter value. My hardcoded current value is "Australia". Through this table, I will change what ever country I want. Also, any other field, such as date or color etc can be used.

shafiz_p_3-1724857039765.png

 

5. Close and load.
6. Go to Model View and select the country list table , and select the column name,  you have created in step 4.

shafiz_p_4-1724857117431.png

7. In the table countrylist, select column CountryName, and go to properties -> advance option. Click bind to parameter drop down and select parameter name, and you are done.

shafiz_p_5-1724857296743.png

8. Create slicer with the countryname column, you have created in step 4. Now when ever you want , you can change the underlying data table based on the slicer selection. Note, slicer will be by default single select.

Remember, my parameter hardcoded value was "Australia", see the image below, it is now United States based on my selection.

shafiz_p_6-1724857506363.png

 

Also, keep remember, table which will be used in slicer to dynamically change value, could be direct or import. Mixed connectivity mode can work.

Hope this helps!!
If this solved your problem, please accept it as a solution, and a thumps up!!



Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.