<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Displaying selected field from Hierarchy slicer on a text box. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/4848263#M185025</link>
    <description>&lt;P data-start="264" data-end="446"&gt;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.&lt;/P&gt;
&lt;P data-start="448" data-end="967"&gt;Selected node name =&lt;BR /&gt;VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))&lt;BR /&gt;VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))&lt;BR /&gt;VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))&lt;BR /&gt;VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))&lt;BR /&gt;VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))&lt;BR /&gt;RETURN COALESCE(v5, v4, v3, v2, v1, "All")&lt;/P&gt;
&lt;P data-start="969" data-end="1036"&gt;If you want a friendly label that includes the level name, use this&lt;/P&gt;
&lt;P data-start="1038" data-end="1827"&gt;Selection label =&lt;BR /&gt;VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))&lt;BR /&gt;VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))&lt;BR /&gt;VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))&lt;BR /&gt;VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))&lt;BR /&gt;VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))&lt;BR /&gt;VAR name = COALESCE(v5, v4, v3, v2, v1)&lt;BR /&gt;VAR level =&lt;BR /&gt;IF(NOT(ISBLANK(v5)), "Location",&lt;BR /&gt;IF(NOT(ISBLANK(v4)), "Reporting Region",&lt;BR /&gt;IF(NOT(ISBLANK(v3)), "Country",&lt;BR /&gt;IF(NOT(ISBLANK(v2)), "Global Region",&lt;BR /&gt;IF(NOT(ISBLANK(v1)), "Corporate", BLANK())))))&lt;BR /&gt;RETURN IF(ISBLANK(name), "All", level &amp;amp; ": " &amp;amp; name)&lt;/P&gt;
&lt;P data-start="1829" data-end="1978"&gt;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&lt;/P&gt;
&lt;P data-start="1980" data-end="2142"&gt;Selected reporting region =&lt;BR /&gt;VAR c = COUNTROWS(VALUES(DimGeo[Reporting Region]))&lt;BR /&gt;RETURN IF(c = 1, SELECTEDVALUE(DimGeo[Reporting Region]), "All reporting regions")&lt;/P&gt;
&lt;P data-start="2144" data-end="2481"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Oct 2025 13:35:29 GMT</pubDate>
    <dc:creator>technolog</dc:creator>
    <dc:date>2025-10-12T13:35:29Z</dc:date>
    <item>
      <title>Displaying selected field from Hierarchy slicer on a text box.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/967607#M11501</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in displaying selected values in my&amp;nbsp;Hierarchy slicer on a text box.&amp;nbsp; 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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example,&lt;img /&gt; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:06:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/967607#M11501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-10T21:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying selected field from Hierarchy slicer on a text box.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/967828#M11514</link>
      <description>I am not infront of my desktop but. I can give your fair idea.&lt;BR /&gt;&lt;BR /&gt;You have to use pathfunction dax.&lt;BR /&gt;&lt;BR /&gt;Just check out Microsoft documentation.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pravin</description>
      <pubDate>Wed, 11 Mar 2020 02:37:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/967828#M11514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-11T02:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying selected field from Hierarchy slicer on a text box.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/4848263#M185025</link>
      <description>&lt;P data-start="264" data-end="446"&gt;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.&lt;/P&gt;
&lt;P data-start="448" data-end="967"&gt;Selected node name =&lt;BR /&gt;VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))&lt;BR /&gt;VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))&lt;BR /&gt;VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))&lt;BR /&gt;VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))&lt;BR /&gt;VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))&lt;BR /&gt;RETURN COALESCE(v5, v4, v3, v2, v1, "All")&lt;/P&gt;
&lt;P data-start="969" data-end="1036"&gt;If you want a friendly label that includes the level name, use this&lt;/P&gt;
&lt;P data-start="1038" data-end="1827"&gt;Selection label =&lt;BR /&gt;VAR v5 = IF(COUNTROWS(VALUES(DimGeo[Location])) = 1, SELECTEDVALUE(DimGeo[Location]))&lt;BR /&gt;VAR v4 = IF(COUNTROWS(VALUES(DimGeo[Reporting Region])) = 1, SELECTEDVALUE(DimGeo[Reporting Region]))&lt;BR /&gt;VAR v3 = IF(COUNTROWS(VALUES(DimGeo[Country])) = 1, SELECTEDVALUE(DimGeo[Country]))&lt;BR /&gt;VAR v2 = IF(COUNTROWS(VALUES(DimGeo[Global Region])) = 1, SELECTEDVALUE(DimGeo[Global Region]))&lt;BR /&gt;VAR v1 = IF(COUNTROWS(VALUES(DimGeo[Corporate])) = 1, SELECTEDVALUE(DimGeo[Corporate]))&lt;BR /&gt;VAR name = COALESCE(v5, v4, v3, v2, v1)&lt;BR /&gt;VAR level =&lt;BR /&gt;IF(NOT(ISBLANK(v5)), "Location",&lt;BR /&gt;IF(NOT(ISBLANK(v4)), "Reporting Region",&lt;BR /&gt;IF(NOT(ISBLANK(v3)), "Country",&lt;BR /&gt;IF(NOT(ISBLANK(v2)), "Global Region",&lt;BR /&gt;IF(NOT(ISBLANK(v1)), "Corporate", BLANK())))))&lt;BR /&gt;RETURN IF(ISBLANK(name), "All", level &amp;amp; ": " &amp;amp; name)&lt;/P&gt;
&lt;P data-start="1829" data-end="1978"&gt;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&lt;/P&gt;
&lt;P data-start="1980" data-end="2142"&gt;Selected reporting region =&lt;BR /&gt;VAR c = COUNTROWS(VALUES(DimGeo[Reporting Region]))&lt;BR /&gt;RETURN IF(c = 1, SELECTEDVALUE(DimGeo[Reporting Region]), "All reporting regions")&lt;/P&gt;
&lt;P data-start="2144" data-end="2481"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Oct 2025 13:35:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-selected-field-from-Hierarchy-slicer-on-a-text-box/m-p/4848263#M185025</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2025-10-12T13:35:29Z</dc:date>
    </item>
  </channel>
</rss>

