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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Displaying selected field from Hierarchy slicer on a text box.

Hello Everyone,

 

I need some help in displaying selected values in my Hierarchy slicer on a text box.  I am using a Hierarchy slicer to slice and dice my data and it has 5 levels in this sequence Corporate, Global Region, Country, Reporting Region, and Location. 

 

For Example,Date.PNG if I am selected any value from the 4th level (Reporting Region) then I want the text box to display that level value on my text box.

 

 

 

 

 

 

2 REPLIES 2
technolog
Super User
Super User

Here is a simple pattern that returns the deepest single selection. It covers both the standard slicer and the Hierarchy Slicer visual. Replace DimGeo with your table name if needed.

Selected node name =
VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))
VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))
VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))
VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))
VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))
RETURN COALESCE(v5, v4, v3, v2, v1, "All")

If you want a friendly label that includes the level name, use this

Selection label =
VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))
VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))
VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))
VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))
VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))
VAR name = COALESCE(v5, v4, v3, v2, v1)
VAR level =
IF(NOT(ISBLANK(v5)), "Location",
IF(NOT(ISBLANK(v4)), "Reporting Region",
IF(NOT(ISBLANK(v3)), "Country",
IF(NOT(ISBLANK(v2)), "Global Region",
IF(NOT(ISBLANK(v1)), "Corporate", BLANK())))))
RETURN IF(ISBLANK(name), "All", level & ": " & name)

If the only thing you care about is Reporting Region, and you want the text to change only when exactly one region is selected, use this lean measure

Selected reporting region =
VAR c = COUNTROWS(VALUES(DimGeo[Reporting Region]))
RETURN IF(c = 1, SELECTEDVALUE(DimGeo[Reporting Region]), "All reporting regions")

 

Anonymous
Not applicable

I am not infront of my desktop but. I can give your fair idea.

You have to use pathfunction dax.

Just check out Microsoft documentation.

Thanks
Pravin

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.