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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
afkhalifeh
Frequent Visitor

Passing a slicer value to a query parameter

Hi,

I need to pass a slicer value to a query parameter.

I created a query parameter named (LanguageParam) and filter my table name (Data) using this parameter. I created a slicer name (Selectlangauge) that takes a single value (“en” for English, “fr” for French) and I want to pass the selected slicer value to the query parameter (LanguageParam).

I tried using the Bind Parameter feature but it is missing from the Model View. Is there any alternative solution?

 

Thanks,

Abdul

6 REPLIES 6
v-jianpeng-msft
Community Support
Community Support

Hi, @afkhalifeh 

You can follow the official tutorial below to create a query query and bind them in a visual:

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

vjianpengmsft_0-1716788693282.png

If you need to read items selected by the slicer, you can use the SeletedValue or SeletedColumn functions. For more information, please click on the following links to learn:

Slicers in Power BI - Power BI | Microsoft Learn

SELECTEDVALUE function - DAX | Microsoft Learn

SELECTCOLUMNS function (DAX) - DAX | Microsoft Learn

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hi,

Thank you for your kind reply.

 

You can download the .pbix file from this link https://drive.google.com/file/d/1b2GoKtc6XzDr7oqvauACMX_idXCDkyf_/view?usp=drive_link

 

As you see, I need to filter the data based on the selected language but the filter didn't work fine.

Hi, @afkhalifeh 

I can't open the link you shared. Please set it as a shared link.

 

Best Regards

Jianpeng Li

Hi, @afkhalifeh 

Can you elaborate on the output you are looking forward to in terms of the sample file you provided? In the provided PBIX file, it now has the same data regardless of the language selected, because there is no corresponding language ID in this table V_Respondents.

 

Best Regards

Jianpeng Li

I need to change the x-axis in the Column Char based on the selected language. For example, if I select English from the slicer, the Name from V_GovernorateDetail must be English, and the same if I choose Arabic as shown in the screenshots below.

 

afkhalifeh_0-1717153774102.png

 

 

afkhalifeh_1-1717153774103.png

 

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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