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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Johan94
Frequent Visitor

Dynamic title using hierarchy

Hi everyone, 

 

I want to have a dynamic title, changing when the user is going to the next level or expanding one level in the hierarchy. Unfortunately, it's only changing when you're going to the next level, but is doesn't chang when you're using the button expanding. 

I tried the functions IsFiltered and IsInscope, but both without succes. Is there another function or a workaround for this? 

Hierarchy expanding.png

1 ACCEPTED SOLUTION

Hi @igrandey89 , 

Thank you for your suggestion. I tried your measure, and adjusted a few things. However, it didn't work (Only "Default Title" became visible). 

I created a workaround: 

I placed a button with a bookmark on the expanding one level in the hierarchy-arrow. So when the user clicks on this, it just redirects you to another chart with a manual title. I placed a button and bookmark on this chart too, to be able to go back. 

 

I have been searching for a while, and I noticed that more people had this issue which weren't solved. So I guess using a dynamic title by clicking on the expanding one level in the hierarchy isn't possible (yet)

View solution in original post

4 REPLIES 4
igrandey89
Advocate II
Advocate II

Awesome!!! Glad I could (sort of) help 😉

igrandey89
Advocate II
Advocate II

To make the dynamic title change when expanding the hierarchy instead of only when drilling down, you can use the HASONEVALUE function along with SELECTEDVALUE. Here's a modified version of your DAX measure that should work:

Dynamic title2 =
VAR CurrentLevel =
    SWITCH (
        TRUE (),
        HASONEVALUE ( Calendar[DayOfWeekName] ), 1,
        HASONEVALUE ( Calendar[Weeknumber] ), 2,
        0
    )
RETURN
    SWITCH (
        CurrentLevel,
        1, "Number of alarms per day and week",
        2, "Number of alarms per week",
        "Default Title"
    )

In this measure, we first create a variable CurrentLevel to identify the current hierarchy level by checking whether the user has drilled down or expanded on the DayOfWeekName or Weeknumber. Then, we return the title based on the value of CurrentLevel.

This should update the title as you expand the hierarchy. However, depending on your data model and how your visualizations are set up, you might need to adjust this code to fit your specific case.

 

Hi @igrandey89 , 

Thank you for your suggestion. I tried your measure, and adjusted a few things. However, it didn't work (Only "Default Title" became visible). 

I created a workaround: 

I placed a button with a bookmark on the expanding one level in the hierarchy-arrow. So when the user clicks on this, it just redirects you to another chart with a manual title. I placed a button and bookmark on this chart too, to be able to go back. 

 

I have been searching for a while, and I noticed that more people had this issue which weren't solved. So I guess using a dynamic title by clicking on the expanding one level in the hierarchy isn't possible (yet)

If it's not already submitted in the PBI Ideas site--I would suggest you do so! https://ideas.powerbi.com/

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.