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
soliverc
Frequent Visitor

Dynamic DAX title not updating with selected value.

I want the title of a slicer to change depending on if something is selected or not. 

 

For example, a slicer with a vertical list of countries. 

 

If there is not country selected, the Slicer title is just: "Country"

If there is a country selected, the Slicer title changes to "Country*" with an asterisk.

 

I have put this piece of code into the Slicer title field (using the fx button).

 

_countrySlicerTitle = 
VAR SelectedCountry = SELECTEDVALUE(data[Country])
RETURN
    IF(ISBLANK(SelectedCountry), "Country", "Country *")

 

However, when I select a country in the slicer, nothing happens to the title. It stays on "Country".

 

If I put the Dax title into a separate card, it updates when something is selected. 

 

What am I doing wrong? Or is this a bug?

 

soliverc_0-1712250630840.png

 

3 REPLIES 3
v-zhouwen-msft
Community Support
Community Support

Hi @amitchandak ,thanks for the quick reply, I'll add further.

Hi @soliverc ,

Regarding your question, I conducted a test and found it to be unattainable.Because in the chart title conditional formatting, the 'SELECTEDVALUE' can only return when it's been filtered but not been highlighted.I created a second slicer for the title to take effect.

vzhouwenmsft_0-1712567343267.png

You may be able to achieve your needs indirectly by combining card visualization objects.

Measure = IF(ISFILTERED('Table'[Country]) = FALSE(),"Country","Country*")

vzhouwenmsft_1-1712567597998.png

 


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

amitchandak
Super User
Super User

@soliverc , seems like you are creating a calculated column. A calculated column can not use selected values. Only measure can use

It's a measure. I clicked "New Measure" not "New Column"

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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