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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mikmokmuk
Regular Visitor

Selected Values in Slicer

Hi guys,

 

we are trying to get the values selected in a given slicer. Idealy, we would like to return it as a text format. For instance, we have a slicer with the values:

 

A [  ]

B [X]

C [X]

 

Would be possible to return something like "BC".

 

Thank you,

1 ACCEPTED SOLUTION

Hi Mik,

 

It should be a measure rather than a calculated column. Please try it. The calculated column won't respond to the slicer for now.Selected Values in Slicer2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Dale

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

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @mikmokmuk,

 

Please try the formula below.

//if there isn't any selection, this formula will return all the values. So ISFILTERD is here.
SelectedInSlicer = IF ( ISFILTERED ( DimProduct[ColorName] ), CONCATENATEX ( VALUES ( DimProduct[ColorName] ), [ColorName], "-" ) )

Selected_Values_in_Slicer

 

Best Regards,

Dale

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

Hi Dale,

 

thank you for your reply. We have tried your suggested formula and is not working, see screenshot. I have attached a sample of out pbix file here in dropbox. Would you mind to take a look into?

 

https://www.dropbox.com/s/eef2twfw72gp1gt/EXERCISE.pbix?dl=0

 

Many thanks,

Mik

Hi Mik,

 

It should be a measure rather than a calculated column. Please try it. The calculated column won't respond to the slicer for now.Selected Values in Slicer2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Dale

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

@mikmokmuk

In addition to the solution provided by @v-jiascu-msft 

Look at my solution here...

https://community.powerbi.com/t5/Desktop/See-visually-what-filters-have-been-applied/m-p/178196#M779...

It includes the above but can also give you some ideas on how you can modify the Measure further.

One thing you may consider is limiting how many items you list in the Card Visual before you say “Multiple”

Hope this helps! Smiley Happy

Anonymous
Not applicable

I successfully created a measure that returns the value selected in the slicer - thank you! but now, I'd like to use this measure to calculate a column with the expression "If ('Table'[Year} <= ValueSelectedInSlicer, "Reached Phase","Did Not Reach Phase") for all rows. But someone mentioned this earlier, that we cannot use the measure that returns the value selected in the slicer in a column. Is there an alternative way to execute what I'm describing?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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