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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
William29
Helper I
Helper I

How to use text options rather than numbers in 'What if Parameter'

I am wanting to use something like a 'what if' parameter that allows the user to select between a few countries such as:

China, India, USA etc.

 

However, when I go to create a 'what if parameter' it only allows for a numerical data type, it does not allow you to use words, or to insert a list of words, that the user can choose from. Can this be achieved somehow?

 

It is important that the selected word/country can be accessed within a python visualization script. I note that instead of using a 'what if parameter' you can create a slicer from the visualization pane and add the appropriate column of the data set (containing the countries/words to choose from) within the slicer's field. This allows the user to choose from a list of countries. However, this solution does not appear acceptable as it doesnt appear that you can access the chosen value of the slicer within a python visualization script.

 

So the question is: Is anyone able to tell me whether you can use a selection of words as the options to pick from, within a 'what if parameter', or if not, instead, is there a way to access the selected option of a slicer, within a python visualization script? Otherwise, is there some other way to achieve the same result (allow the user to pick from a number of word options and have the selected value accessible within a pythopn visualization script)?

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

as it doesnt appear that you can access the chosen value of the slicer within a python visualization script.

You can make it work by using the exact same field in both the slicer and the python visual.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Yes. The word you are looking for is Filter Context.

lbendlin
Super User
Super User

as it doesnt appear that you can access the chosen value of the slicer within a python visualization script.

You can make it work by using the exact same field in both the slicer and the python visual.

@lbendlinBy the same field, do you mean the column that the slicer is based. If I add this column to 'values' in the python visual, will this mean that I will have access to the chosen value of the slicer rather than the column itself (this is what I want)?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.