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
Irfan_2020
New Member

Dynamic title for slicer

Hi forks,

Hope u r doing well... I am facing this problem in slicer from past few days in power Bi. 

 

1st1st

 

First Image; Its a Default image of the Data showing Category, Sub category without using the filter and the all the data is unselected.

 

 

 

 

2nd2nd

 

Second Image; In this part of filter I have selected Category FURNITURE & the title for the sub category also changes. As I have written a DAX function for Dynamic title.

 

 

3rd3rd

 

Third Image; In this part.... I am selecting Chairs in the Sub Category but the title for sub category is not changing & the slicer of OFFICE SUPPLIES & TECHNOLOGY is visible. I want to disable OFFICE SUPPLIERS & TECHNOLOGY in the slicers.

 

 

 

Is it possible for the Slicer title to change while selecting the sub category. Slicer title should be FURNITURE when selecting sub category chair. (OR)

Is it possible for the slicer to change from default to FURNITURE while selecting the sub category CHAIR. 

 

Is there any DAX functions or some settings. 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Irfan_2020 ,

According to your description, if you want to change the title dynamically by the Title conditional fomatting in the Formatting pane like below, by my test, it can't be achieved. 

vkalyjmsft_0-1654586306377.png

Because in the chart title conditional formatting, the SELECTEDVALUE can only return when it's been filtered but not been highlighted, you can create a simple code "SELECTEDVALUE('Table'[Sub-category])" to verify.

 

Additonally, there's another problem, a chart/table can't filter a slicer anyway, you can give more examples to verify it.

 

As for now, my workaroud is to change the category slicer to a table visual and create a card visual above the chart title then group them. Follow the steps:

1.Change the category slicer to a table visual, and the interaction type from category table to chart should be filter, but not hightlight.

vkalyjmsft_1-1654587371838.png

2.Create a measure.

Title =
"Sales by Sub-category of "
    & IF (
        SELECTEDVALUE ( 'Table'[Sub-category] ) <> BLANK (),
        SELECTEDVALUE ( 'Table'[Sub-category] ),
        IF (
            ISFILTERED ( 'Table'[Category] ),
            SELECTEDVALUE ( 'Table'[Category] ),
            "overall Category"
        )
    )

Put it in a card visual, change the font size and turn off the category label.

vkalyjmsft_2-1654587645582.png

3.Put the card visual above the chart, select them at the same time, right click and select Group.

vkalyjmsft_3-1654587895764.png

4.Get the result.

vkalyjmsft_4-1654587977207.png

vkalyjmsft_5-1654587998682.png

vkalyjmsft_6-1654588011965.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Irfan_2020 ,

According to your description, if you want to change the title dynamically by the Title conditional fomatting in the Formatting pane like below, by my test, it can't be achieved. 

vkalyjmsft_0-1654586306377.png

Because in the chart title conditional formatting, the SELECTEDVALUE can only return when it's been filtered but not been highlighted, you can create a simple code "SELECTEDVALUE('Table'[Sub-category])" to verify.

 

Additonally, there's another problem, a chart/table can't filter a slicer anyway, you can give more examples to verify it.

 

As for now, my workaroud is to change the category slicer to a table visual and create a card visual above the chart title then group them. Follow the steps:

1.Change the category slicer to a table visual, and the interaction type from category table to chart should be filter, but not hightlight.

vkalyjmsft_1-1654587371838.png

2.Create a measure.

Title =
"Sales by Sub-category of "
    & IF (
        SELECTEDVALUE ( 'Table'[Sub-category] ) <> BLANK (),
        SELECTEDVALUE ( 'Table'[Sub-category] ),
        IF (
            ISFILTERED ( 'Table'[Category] ),
            SELECTEDVALUE ( 'Table'[Category] ),
            "overall Category"
        )
    )

Put it in a card visual, change the font size and turn off the category label.

vkalyjmsft_2-1654587645582.png

3.Put the card visual above the chart, select them at the same time, right click and select Group.

vkalyjmsft_3-1654587895764.png

4.Get the result.

vkalyjmsft_4-1654587977207.png

vkalyjmsft_5-1654587998682.png

vkalyjmsft_6-1654588011965.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

 

SergioSilvaPT
Resolver V
Resolver V

Hi @Irfan_2020 ,

 

You can create a simple measure and use it as title for your slicer.

Example:

Slicer Title = SELECTEDVALUE(Sales[Product Category])

In the selectedvalue choose the column with Category.

If you want you can also show a message when no filter is applied, like:

 

Slicer Title = IF
ISFILTERED(Sales[Product Category]),
SELECTEDVALUE(Sales[Product Category]),
"All Categories"
)

 

Regards,

Sérgio Silva 

 
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Regards,
Sérgio Silva

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

Check out my blog for tips and tricks about Power BI: https://pbibits.wordpress.com/

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.