<?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 Dynamic Measure filtering issue: Excluding specific sub-segment only in one &amp;quot;View&amp;quot; (SWITCH context) in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5160631#M13145</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm struggling with a DAX filtering logic where I need to exclude a specific sub-segment value from one calculation path without affecting the other.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Context:&lt;/STRONG&gt; I have a report with a toggle between two main views: &lt;STRONG&gt;Insurance&lt;/STRONG&gt; and &lt;STRONG&gt;Other&lt;/STRONG&gt;. This is controlled by a calculated column that groups my sub-segments.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Calculated Column:&lt;/STRONG&gt;&lt;BR /&gt;Sub_Segment_grouped2 =&lt;BR /&gt;IF (&lt;BR /&gt;'Subsegment'[Sub_Segment] IN { "Health", "P&amp;amp;C", "Life", "Equity" },&lt;BR /&gt;"Insurance",&lt;BR /&gt;"Other"&lt;BR /&gt;)&lt;BR /&gt;&lt;STRONG&gt;The Current Measures:&lt;/STRONG&gt; I use a dynamic "Stack" measure to switch between the views:&lt;BR /&gt;&lt;BR /&gt;Total Profit before tax - Stack Dynamic =&lt;BR /&gt;VAR subSeg = SELECTEDVALUE ( 'Subsegment'[Sub_Segment_grouped2] )&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH (&lt;BR /&gt;subSeg,&lt;BR /&gt;"Insurance", [Total Profit before tax - Stack insurance],&lt;BR /&gt;"Other", [Total Profit before tax - Stack Other],&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;BR /&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt; In my data, &lt;STRONG&gt;"Equity"&lt;/STRONG&gt; is technically mapped to &lt;STRONG&gt;"Insurance"&lt;/STRONG&gt; (as seen in my calculated column). However, when the user selects the &lt;STRONG&gt;"Other"&lt;/STRONG&gt; view, the visual still aggregates data where Sub_Segment = "Equity" into the "Other" totals/visuals because of the underlying filter context.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt; When Sub_Segment_grouped2 is &lt;STRONG&gt;"Other"&lt;/STRONG&gt;, I want to explicitly exclude/subtract any data where Sub_Segment = "Equity".&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Requirement:&lt;/STRONG&gt; This must NOT affect the "Insurance" view.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; For a specific company, the "Other" view currently shows 34M. 15M of that is "Equity". I want the "Other" view to show only 19M (34-15), while the "Insurance" view remains untouched.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I've tried wrapping the SWITCH in a CALCULATE with a filter, but it's not producing the expected result in the stacked bar chart.&lt;/P&gt;&lt;P&gt;How can I modify Total Profit before tax - Stack Other to strictly ignore the "Equity" sub-segment regardless of the grouping?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_0-1777445862075.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335187iCF829893743F5330/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_0-1777445862075.png" alt="AlonCarmel_0-1777445862075.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_1-1777445874855.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335188iF5B0F7AD17CDB813/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_1-1777445874855.png" alt="AlonCarmel_1-1777445874855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_2-1777445906791.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335189i2E0AC3599BF7189A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_2-1777445906791.png" alt="AlonCarmel_2-1777445906791.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2026 06:58:37 GMT</pubDate>
    <dc:creator>AlonCarmel</dc:creator>
    <dc:date>2026-04-29T06:58:37Z</dc:date>
    <item>
      <title>Dynamic Measure filtering issue: Excluding specific sub-segment only in one "View" (SWITCH context)</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5160631#M13145</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm struggling with a DAX filtering logic where I need to exclude a specific sub-segment value from one calculation path without affecting the other.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Context:&lt;/STRONG&gt; I have a report with a toggle between two main views: &lt;STRONG&gt;Insurance&lt;/STRONG&gt; and &lt;STRONG&gt;Other&lt;/STRONG&gt;. This is controlled by a calculated column that groups my sub-segments.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Calculated Column:&lt;/STRONG&gt;&lt;BR /&gt;Sub_Segment_grouped2 =&lt;BR /&gt;IF (&lt;BR /&gt;'Subsegment'[Sub_Segment] IN { "Health", "P&amp;amp;C", "Life", "Equity" },&lt;BR /&gt;"Insurance",&lt;BR /&gt;"Other"&lt;BR /&gt;)&lt;BR /&gt;&lt;STRONG&gt;The Current Measures:&lt;/STRONG&gt; I use a dynamic "Stack" measure to switch between the views:&lt;BR /&gt;&lt;BR /&gt;Total Profit before tax - Stack Dynamic =&lt;BR /&gt;VAR subSeg = SELECTEDVALUE ( 'Subsegment'[Sub_Segment_grouped2] )&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH (&lt;BR /&gt;subSeg,&lt;BR /&gt;"Insurance", [Total Profit before tax - Stack insurance],&lt;BR /&gt;"Other", [Total Profit before tax - Stack Other],&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;BR /&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt; In my data, &lt;STRONG&gt;"Equity"&lt;/STRONG&gt; is technically mapped to &lt;STRONG&gt;"Insurance"&lt;/STRONG&gt; (as seen in my calculated column). However, when the user selects the &lt;STRONG&gt;"Other"&lt;/STRONG&gt; view, the visual still aggregates data where Sub_Segment = "Equity" into the "Other" totals/visuals because of the underlying filter context.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt; When Sub_Segment_grouped2 is &lt;STRONG&gt;"Other"&lt;/STRONG&gt;, I want to explicitly exclude/subtract any data where Sub_Segment = "Equity".&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Requirement:&lt;/STRONG&gt; This must NOT affect the "Insurance" view.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; For a specific company, the "Other" view currently shows 34M. 15M of that is "Equity". I want the "Other" view to show only 19M (34-15), while the "Insurance" view remains untouched.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I've tried wrapping the SWITCH in a CALCULATE with a filter, but it's not producing the expected result in the stacked bar chart.&lt;/P&gt;&lt;P&gt;How can I modify Total Profit before tax - Stack Other to strictly ignore the "Equity" sub-segment regardless of the grouping?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_0-1777445862075.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335187iCF829893743F5330/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_0-1777445862075.png" alt="AlonCarmel_0-1777445862075.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_1-1777445874855.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335188iF5B0F7AD17CDB813/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_1-1777445874855.png" alt="AlonCarmel_1-1777445874855.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlonCarmel_2-1777445906791.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1335189i2E0AC3599BF7189A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlonCarmel_2-1777445906791.png" alt="AlonCarmel_2-1777445906791.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2026 06:58:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5160631#M13145</guid>
      <dc:creator>AlonCarmel</dc:creator>
      <dc:date>2026-04-29T06:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure filtering issue: Excluding specific sub-segment only in one "View" (SW</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5160850#M13146</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see the fix is straightforward,just add the Equity exclusion directly inside your Total Profit before tax - Stack Other measure using CALCULATE with a filter:&lt;BR /&gt;daxTotal Profit before tax - Stack Other =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Total Profit before tax],&lt;BR /&gt;KEEPFILTERS('Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity")&lt;BR /&gt;)&lt;BR /&gt;Using KEEPFILTERS here is important , it adds the exclusion on top of whatever filter context already exists from the visual, rather than replacing it. That way it only excludes Equity in that measure without touching what happens in the Insurance path.&lt;BR /&gt;Your SWITCH logic stays exactly as is, since the filtering lives inside the Other measure itself. The Insurance measure never sees this filte&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2026 13:29:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5160850#M13146</guid>
      <dc:creator>Juan-Power-bi</dc:creator>
      <dc:date>2026-04-29T13:29:33Z</dc:date>
    </item>
  </channel>
</rss>

