<?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 Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803767#M183735</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;single selection&lt;/STRONG&gt; from slicer (type-1/type-2/type-3) then need to see the data value like below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;single selection&lt;/STRONG&gt; from slicer&lt;STRONG&gt;&amp;nbsp;(type-12 only)&lt;/STRONG&gt;&amp;nbsp;which is a stacked chart, combination of type-1 and type-2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;multiple selection&lt;/STRONG&gt; from slicer then no individual data label will come (will show only total).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using a DAX measure in Power BI to hide data labels when selecting&lt;SPAN&gt;&amp;nbsp;t&lt;/SPAN&gt;&lt;STRONG&gt;ype-1&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;t&lt;/SPAN&gt;&lt;STRONG&gt;ype-2&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;(at the same time)&amp;nbsp;&lt;/SPAN&gt;from a slicer. But, it is not working. It is showing (individual data labels, and total data labels both)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Data Label = 
VAR SelectedCategories = VALUES(type_sort[type])  -- Get all selected categories
VAR ConcatenatedSelection = CONCATENATEX(SelectedCategories, [type], ", ")

RETURN
IF(
    ConcatenatedSelection = "type-1, type-2",
    "",  -- Hide the data label
    [describeMeasure]  -- Otherwise, show the data label
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I mentioned before, I need to turn on total labels&amp;nbsp;on to see the total for the type-12 (when selecting it only). I also need to turned on the data labels to see data point when selecting a single selection of type-1/type-2/type-3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has suggestions for improving the DAX or alternative approaches to achieve this behavior, I’d really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find the Power BI file here: [&lt;A href="https://drive.google.com/file/d/14a04uN2S5EoqQRgLQ53mJR-vFaPpdOHi/view?usp=sharing" target="_self"&gt;link&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Aug 2025 13:27:21 GMT</pubDate>
    <dc:creator>0Experience</dc:creator>
    <dc:date>2025-08-21T13:27:21Z</dc:date>
    <item>
      <title>Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803767#M183735</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;single selection&lt;/STRONG&gt; from slicer (type-1/type-2/type-3) then need to see the data value like below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;single selection&lt;/STRONG&gt; from slicer&lt;STRONG&gt;&amp;nbsp;(type-12 only)&lt;/STRONG&gt;&amp;nbsp;which is a stacked chart, combination of type-1 and type-2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select &lt;STRONG&gt;multiple selection&lt;/STRONG&gt; from slicer then no individual data label will come (will show only total).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using a DAX measure in Power BI to hide data labels when selecting&lt;SPAN&gt;&amp;nbsp;t&lt;/SPAN&gt;&lt;STRONG&gt;ype-1&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;t&lt;/SPAN&gt;&lt;STRONG&gt;ype-2&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;(at the same time)&amp;nbsp;&lt;/SPAN&gt;from a slicer. But, it is not working. It is showing (individual data labels, and total data labels both)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Data Label = 
VAR SelectedCategories = VALUES(type_sort[type])  -- Get all selected categories
VAR ConcatenatedSelection = CONCATENATEX(SelectedCategories, [type], ", ")

RETURN
IF(
    ConcatenatedSelection = "type-1, type-2",
    "",  -- Hide the data label
    [describeMeasure]  -- Otherwise, show the data label
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I mentioned before, I need to turn on total labels&amp;nbsp;on to see the total for the type-12 (when selecting it only). I also need to turned on the data labels to see data point when selecting a single selection of type-1/type-2/type-3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone has suggestions for improving the DAX or alternative approaches to achieve this behavior, I’d really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find the Power BI file here: [&lt;A href="https://drive.google.com/file/d/14a04uN2S5EoqQRgLQ53mJR-vFaPpdOHi/view?usp=sharing" target="_self"&gt;link&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 13:27:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803767#M183735</guid>
      <dc:creator>0Experience</dc:creator>
      <dc:date>2025-08-21T13:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803837#M183738</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678938" data-lia-user-login="0Experience" class="lia-mention lia-mention-user"&gt;0Experience&lt;/a&gt;&amp;nbsp;Is there a particular reason your relationship is not active? You should be able to solve this with conditional formatting for your Data Label values.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:00:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803837#M183738</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-08-21T14:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803843#M183739</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;thanks Greg. If I make the relationship active then I can not see type-12 in my visual (if I select it from slicer).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:04:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803843#M183739</guid>
      <dc:creator>0Experience</dc:creator>
      <dc:date>2025-08-21T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803862#M183740</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678938" data-lia-user-login="0Experience" class="lia-mention lia-mention-user"&gt;0Experience&lt;/a&gt;&amp;nbsp;The way you have this configured I don't think it is actually possible. The reason is that you want the label to be visible and invisible under technically the same conditions. I realize that this might not sound correct but create two measures like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 1 = COUNTROWS( 'Test_Data_Table' )

Measure 2 = COUNTROWS( 'type_sort' )&lt;/LI-CODE&gt;&lt;P&gt;Use each of those in turn for you data labels and you'll see what I mean.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:21:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803862#M183740</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2025-08-21T14:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803914#M183745</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; You're probably right, it might not be possible to display this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggested methods. While Measure 2 correctly shows a count of 4 when I select four types from the slicer, the visual still displays only 1 (it make sense too).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also applied a condition like “if Measure 2 &amp;gt; 2, then hide data labels,” but unfortunately, it didn’t.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still, I really appreciate your time and thoughtful suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 15:17:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803914#M183745</guid>
      <dc:creator>0Experience</dc:creator>
      <dc:date>2025-08-21T15:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803978#M183751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678938" data-lia-user-login="0Experience" class="lia-mention lia-mention-user"&gt;0Experience&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;(again) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might have made it, the file is here, can you check this satisfies your requirements? The only thing that seems to me impossible is to hide the labels if you select multiple items differently than type1 and type-12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/14HuWjOKld9A5x-oHacplyMRa6J5rNyjd?usp=sharing" target="_blank"&gt;https://drive.google.com/drive/folders/14HuWjOKld9A5x-oHacplyMRa6J5rNyjd?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I helped&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helped, please consider giving kudos and mark as a solution&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;@me in replies or I'll lose your thread&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Want to check your DAX skills? &lt;A href="https://www.linkedin.com/company/kubisco/" target="_blank"&gt;Answer my biweekly DAX challenges on the kubisco Linkedin page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Consider voting &lt;A href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/Power-BI-Filter-Pane-as-an-icon-on-the-right-side-bar-in-on/idi-p/4728588" target="_blank"&gt;this Power BI idea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Francesco Bergamaschi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MBA, M.Eng, M.Econ, Professor of BI&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 16:10:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4803978#M183751</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-08-21T16:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4804075#M183757</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;Thank you so much for your time, your help, and the code you shared, I truly appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was good to see that the code worked partially. However, when I applied it to my actual dashboard, it unfortunately didn’t behave as expected (even for Type-12 and type-1) too. The data labels are still showing for every combination.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still, I’m really grateful for your support and suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 18:25:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4804075#M183757</guid>
      <dc:creator>0Experience</dc:creator>
      <dc:date>2025-08-21T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4805198#M183806</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The code works fine when I kept both&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Data Labels&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Total Labels&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;turned on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Data_Label = 
VAR SelectedTypes = ALLSELECTED(type_sort[type])
VAR SelectedCount = COUNTROWS(SelectedTypes)

RETURN
IF(
    SelectedCount = 1 &amp;amp;&amp;amp;
    MAX(type_sort[type]) IN { "type-1", "type-2", "type-3" },
    [describeMeasure],
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select only type-1&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select combination of type-1/type-2/type-3&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select only type-12&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select any combination of type-1/type-2/type-3/type-12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: While ChatGPT provided the final working code, I had already shared the initial code, expected output, and other relevant details. It took a few iterations to get everything functioning correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to everyone who engaged with my post and offered helpful suggestions, your input was truly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 15:21:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Only-Total-Labels-for-Stacked-Bar-Chart-with-Conditional/m-p/4805198#M183806</guid>
      <dc:creator>0Experience</dc:creator>
      <dc:date>2025-08-22T15:21:13Z</dc:date>
    </item>
  </channel>
</rss>

