Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
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, 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.
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")
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |