Forum Discussion

HaiVN's avatar
HaiVN
Icon for Helper III rankHelper III
5 months ago
Solved

Dynamic Title with hierarki

Hello, 
Can anyone help me!
I have a slice with  hieareki location ( City--> Zone) . I want to create a dynamic title to the graph. 
When I choose All in slice it will show " USA" i the titel. 
When I choose 'New York' or  Chicago" in the slice it will show " New York" or "Chicagoi the titel. 
When I choose 'Zone 1- NY' and "Zone 2 -NY" in slice it will show " Zone 1- NY" and "Zone 2 -NY"i the tittel. 
---

 
CountryCityZone
USANew YorkZone 1 -NY
USANew YorkZone 2 -NY
USANew YorkZone 3 -NY
USAChicagoZone 1 -CHI
USAChicagoZone 2 -CHI

Thank You!
__

  • Hi,

    Dynamic Title =
    VAR SelectedZone = VALUES('Table'[Zone])
    VAR SelectedCity = VALUES('Table'[City])
    VAR SelectedCountry = SELECTEDVALUE('Table'[Country])

    RETURN
    SWITCH(
    TRUE(),

    ISFILTERED('Table'[Zone]),
    CONCATENATEX(SelectedZone, 'Table'[Zone], ", "),

    ISFILTERED('Table'[City]),
    CONCATENATEX(SelectedCity, 'Table'[City], ", "),

    SelectedCountry
    )

    To apply:
    Go to Title -> Conditional Formatting (Fx)

    Choose Format by "Field Value" and select measure "Dynamic Title" that we created.

     

    Let me know if that helps!

4 Replies

  • Hi,

    Dynamic Title =
    VAR SelectedZone = VALUES('Table'[Zone])
    VAR SelectedCity = VALUES('Table'[City])
    VAR SelectedCountry = SELECTEDVALUE('Table'[Country])

    RETURN
    SWITCH(
    TRUE(),

    ISFILTERED('Table'[Zone]),
    CONCATENATEX(SelectedZone, 'Table'[Zone], ", "),

    ISFILTERED('Table'[City]),
    CONCATENATEX(SelectedCity, 'Table'[City], ", "),

    SelectedCountry
    )

    To apply:
    Go to Title -> Conditional Formatting (Fx)

    Choose Format by "Field Value" and select measure "Dynamic Title" that we created.

     

    Let me know if that helps!

  • HaiVN 

     

    Dynamic Title = 
    SWITCH(
    TRUE(),
    HASONEVALUE(Location[Zone]), "USA - " & SELECTEDVALUE(Location[Zone]),
    HASONEVALUE(Location[City]), "USA - " & SELECTEDVALUE(Location[City]),
    "USA"
    )

    If this answer helped, please click 👍 or Accept as Solution.
    -Kedar
    LinkedIn: https://www.linkedin.com/in/kedar-pande