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
xelune
Regular Visitor

Dynamic title for hierarchy slicer: How to always show lowest selected level

Hi there, 

 

I have a report that has KPIs structured into two columns, who are hierarchical - "Task" and "CoreTask". Each CoreTask has at least one, some multiple tasks. 

I solved the selection with a hierarchy slicer: CoreTask as Level 1 -> Task as Level 2

 

What I would like to do is have a dynamic header that always shows the lowest level selection - if a CoreTask and no Task is selected show CoreTask title; if a Task to a CoreTask is selected, only show Task title. The selection setting is single-selection. If a CoreTask is selected with no Task selected, it automatically selects all Tasks (could this be an issue?)

 

I have tried with the following DAX but I cannot get the title, except the prefix "active: " to show up. I would really appreciate if you could help me out here.

 

SlicerSelectionTitle =

IF(
    ISFILTERED('Finances'[Task]),
    "active: " & SELECTEDVALUE('Finances'[Task]),

        IF(
            ISFILTERED('Finances'[CoreTask]),
             "active: " & SELECTEDVALUE('Finances'[CoreTask])
    )
)

 

Dynamic Header based on Hierarchical Slicer Selection in Power BI | BI Consulting Pro | Power BI |4K... <- my resource for writing the DAX above

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

Hi @xelune ,
According to your description, first of all, when you select the parent category you select the child category by default, because the parent category has a higher priority than the child category, which is the logic of how the hierarchical slicer works. If you don't want to select the parent category and just want to focus on the subcategories, you can try to use the custom visual object Hierarchy Slicer and select one of them to act only on the leaf level

vheqmsft_0-1713506201169.png

vheqmsft_1-1713506223216.png

Next is the solution to the header
Depending on your needs, you can use a card instead of a slicer header and use your created measure to put in and close the slicer header and the Card Category lable so that you can dynamically change the slicer header

vheqmsft_2-1713506883764.png

Of course you can also use the Show Summary feature of the Slicer header, which will show you the level and details you have selected.

vheqmsft_3-1713507009538.png

 

Best regards,

Albert He

 

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-heq-msft
Community Support
Community Support

Hi @xelune ,
According to your description, first of all, when you select the parent category you select the child category by default, because the parent category has a higher priority than the child category, which is the logic of how the hierarchical slicer works. If you don't want to select the parent category and just want to focus on the subcategories, you can try to use the custom visual object Hierarchy Slicer and select one of them to act only on the leaf level

vheqmsft_0-1713506201169.png

vheqmsft_1-1713506223216.png

Next is the solution to the header
Depending on your needs, you can use a card instead of a slicer header and use your created measure to put in and close the slicer header and the Card Category lable so that you can dynamically change the slicer header

vheqmsft_2-1713506883764.png

Of course you can also use the Show Summary feature of the Slicer header, which will show you the level and details you have selected.

vheqmsft_3-1713507009538.png

 

Best regards,

Albert He

 

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

 



Thank you, the card solution is a good workaround. You do not by any chance happen to know how I can then have one background around the card visual and slicer? 

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.