Forum Discussion

krutcher's avatar
krutcher
Regular Visitor
3 years ago

Dynamically change titles by using a hierarchy level

Hi PowerBI Community,

 

I have 2 levels of the hierarchy in the in the TreeMap visual. 1st one is Origin and 2nd

one is Channel. I have to create a dynamic title which will be displayed according to which level of the hierarchy is currently chosen by user selecting “Go to next level of the hierachy” (double arrows). Without user selecting any origin or channel.

Few solutions on the web suggested using SELECTEDVALUE but it only works when the user clicks directly on one of the Origin categories.

I have also tried ISFILTERED but it works in a similar way.

I have already read multiple blogposts and articles on the web and still could not figure it out.

Here were some suggested articles:

https://community.powerbi.com/t5/Desktop/Get-drill-down-hierarchy-level-from-Axis-on-column-chart-with/m-p/269554

 

https://data-marc.com/2019/05/05/dynamic-object-titles-in-power-bi/#:~:text=Dynamic%20visual%20titles%20in%20Power,by%20drilling%20in%20a%20hierarchy.

 

Chris Webb's BI Blog: Dynamic Chart Titles In Power BI Chris Webb's BI Blog (crossjoin.co.uk)

 

There was also a suggestion to create some artificial icons mirroring the buttons and then bookmark the visual according to the selection on those buttons, but this seems a solution by force.

 

Main problem is whether it is possible to recognize somehow the level of the hierarchy in the drilldown.

I have discussed this also with more senior colleague and he mentioned that perhaps just PowerBI does not offer such functionality.

However, I wanted to check, if somebody else faced the same issue and got it resolved.

 

Origin:

 

Channel:

Thank you,

krutcher

 

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Greg_Deckler
      I'm having this issue too even using ISINSCOPE for a line chart visual. 
      Here's the DAX Code I'm using:

       

      Historical view hierarchy - Dynamic Title :=
      VAR HierarchyLevelSelected =
      SWITCH(
          TRUE(),
          ISINSCOPE(Dim_CalendarDate[YearInt]),"Yearly View"
          ,ISINSCOPE(Dim_CalendarDate[CalendarQuarter]),"Quarterly View"
          ,ISINSCOPE(Dim_CalendarDate[CalendarMonth]),"Monthly View"
          ,ISINSCOPE(Dim_CalendarDate[CalendarWeek]),"Weekly View"
          ,ISINSCOPE(Dim_CalendarDate[CalendarDate]),"Daily View"
      )
      RETURN
      "Historical " & HierarchyLevelSelected

       


      This is returning the following value in the title:
       "Historical "

      Do you know another way to extract the hierarchy level from the X axis and use it on the Visual Title? 

      krutcher - did you find a workaround?

      Thanks for your help,
      Victor Andarcia 

  • krutcher's avatar
    krutcher
    Regular Visitor

    Already tried that before and the results where worse than ISFILTERED as it didnt recognized even if the user clicks on one of the origin/channel tiles. 😞