<?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: Dynamic Measure filtering issue: Excluding specific sub-segment only in one &amp;quot;View&amp;quot; (SW 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/5271033#M13213</link>
    <description>&lt;P&gt;The issue comes from &lt;STRONG&gt;filter context&lt;/STRONG&gt;. Your SWITCH() measure only decides &lt;STRONG&gt;which measure to return&lt;/STRONG&gt;—it does &lt;STRONG&gt;not&lt;/STRONG&gt; modify the existing filter context. If Equity is still present in the current context, your [Total Profit before tax - Stack Other] measure will continue to include it unless you explicitly remove it.&lt;/P&gt;&lt;P&gt;Instead of applying the filter around the SWITCH(), apply it &lt;STRONG&gt;inside the "Other" calculation only&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Other =
CALCULATE (
    [Total Profit before tax],
    KEEPFILTERS (
        'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"
    )
)&lt;/PRE&gt;&lt;P&gt;Then keep your dynamic measure as:&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Dynamic =
VAR ViewSelected =
    SELECTEDVALUE ( 'Subsegment'[Sub_Segment_grouped2] )

RETURN
SWITCH (
    ViewSelected,
    "Insurance", [Total Profit before tax - Stack insurance],
    "Other", [Total Profit before tax - Stack Other],
    BLANK()
)&lt;/PRE&gt;&lt;H3&gt;Why this works&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The &lt;STRONG&gt;Insurance&lt;/STRONG&gt; measure is left completely unchanged.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The &lt;STRONG&gt;Other&lt;/STRONG&gt; measure always adds an extra filter that excludes Equity.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;KEEPFILTERS() preserves all existing slicers and visual filters while adding the exclusion for Equity.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Since the exclusion is applied only inside the &lt;STRONG&gt;Other&lt;/STRONG&gt; measure, the Insurance view continues to include Equity if required.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;If Equity still appears&lt;/H3&gt;&lt;P&gt;If Equity continues to be included, it's likely because another table or relationship is reintroducing the filter context. In that case, explicitly remove the existing Sub_Segment filter before applying your own:&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Other =
CALCULATE (
    [Total Profit before tax],
    REMOVEFILTERS ( 'Subsegment'[Sub_Segment] ),
    'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"
)&lt;/PRE&gt;&lt;H3&gt;Debug Tip&lt;/H3&gt;&lt;P&gt;To verify the active filter context, create a temporary measure:&lt;/P&gt;&lt;PRE&gt;Selected Sub Segment =
CONCATENATEX (
    VALUES ( 'Subsegment'[Sub_Segment] ),
    'Subsegment'[Sub_Segment],
    ", "
)&lt;/PRE&gt;&lt;P&gt;Place this in a table or card visual. It will show which Sub_Segment values are actually present in the filter context, making it much easier to identify whether the issue is caused by the measure, the visual, or the data model.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key takeaway:&lt;/STRONG&gt; SWITCH() only changes which measure is evaluated—it does not change filter context. Apply the Equity exclusion inside the &lt;STRONG&gt;Other&lt;/STRONG&gt; measure using CALCULATE() so the logic affects only that branch while leaving the Insurance calculation untouched.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jul 2026 07:42:21 GMT</pubDate>
    <dc:creator>Prince0011</dc:creator>
    <dc:date>2026-07-05T07:42:21Z</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>
    <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/5226122#M13190</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Try applying the filter directly in the &lt;STRONG&gt;Other&lt;/STRONG&gt; measure:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN&gt;Total Profit before tax - Stack Other =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    [Total Profit before tax],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;This excludes &lt;STRONG&gt;Equity&lt;/STRONG&gt; only from the &lt;STRONG&gt;Other&lt;/STRONG&gt; calculation while leaving the &lt;STRONG&gt;Insurance&lt;/STRONG&gt; view unchanged. If it still appears, share the definition of [Total Profit before tax - Stack Other] for further troubleshooting.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Jun 2026 09:26:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5226122#M13190</guid>
      <dc:creator>jasonmiller11tt</dc:creator>
      <dc:date>2026-06-22T09:26:57Z</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/5256755#M13210</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Try this in your &lt;STRONG&gt;Other measure:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN&gt;Total Profit before tax - Stack Other =&lt;BR /&gt;&lt;SPAN&gt;CALCULATE(&lt;BR /&gt;&lt;SPAN&gt;    [Total Profit before tax],&lt;BR /&gt;&lt;SPAN&gt;    'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Keep your Insurance measure unchanged. This removes Equity only from the Other view and leaves Insurance unaffected.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 Jun 2026 10:35:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5256755#M13210</guid>
      <dc:creator>william1234</dc:creator>
      <dc:date>2026-06-30T10:35:53Z</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/5271033#M13213</link>
      <description>&lt;P&gt;The issue comes from &lt;STRONG&gt;filter context&lt;/STRONG&gt;. Your SWITCH() measure only decides &lt;STRONG&gt;which measure to return&lt;/STRONG&gt;—it does &lt;STRONG&gt;not&lt;/STRONG&gt; modify the existing filter context. If Equity is still present in the current context, your [Total Profit before tax - Stack Other] measure will continue to include it unless you explicitly remove it.&lt;/P&gt;&lt;P&gt;Instead of applying the filter around the SWITCH(), apply it &lt;STRONG&gt;inside the "Other" calculation only&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Other =
CALCULATE (
    [Total Profit before tax],
    KEEPFILTERS (
        'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"
    )
)&lt;/PRE&gt;&lt;P&gt;Then keep your dynamic measure as:&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Dynamic =
VAR ViewSelected =
    SELECTEDVALUE ( 'Subsegment'[Sub_Segment_grouped2] )

RETURN
SWITCH (
    ViewSelected,
    "Insurance", [Total Profit before tax - Stack insurance],
    "Other", [Total Profit before tax - Stack Other],
    BLANK()
)&lt;/PRE&gt;&lt;H3&gt;Why this works&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The &lt;STRONG&gt;Insurance&lt;/STRONG&gt; measure is left completely unchanged.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The &lt;STRONG&gt;Other&lt;/STRONG&gt; measure always adds an extra filter that excludes Equity.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;KEEPFILTERS() preserves all existing slicers and visual filters while adding the exclusion for Equity.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Since the exclusion is applied only inside the &lt;STRONG&gt;Other&lt;/STRONG&gt; measure, the Insurance view continues to include Equity if required.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;If Equity still appears&lt;/H3&gt;&lt;P&gt;If Equity continues to be included, it's likely because another table or relationship is reintroducing the filter context. In that case, explicitly remove the existing Sub_Segment filter before applying your own:&lt;/P&gt;&lt;PRE&gt;Total Profit before tax - Stack Other =
CALCULATE (
    [Total Profit before tax],
    REMOVEFILTERS ( 'Subsegment'[Sub_Segment] ),
    'Subsegment'[Sub_Segment] &amp;lt;&amp;gt; "Equity"
)&lt;/PRE&gt;&lt;H3&gt;Debug Tip&lt;/H3&gt;&lt;P&gt;To verify the active filter context, create a temporary measure:&lt;/P&gt;&lt;PRE&gt;Selected Sub Segment =
CONCATENATEX (
    VALUES ( 'Subsegment'[Sub_Segment] ),
    'Subsegment'[Sub_Segment],
    ", "
)&lt;/PRE&gt;&lt;P&gt;Place this in a table or card visual. It will show which Sub_Segment values are actually present in the filter context, making it much easier to identify whether the issue is caused by the measure, the visual, or the data model.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key takeaway:&lt;/STRONG&gt; SWITCH() only changes which measure is evaluated—it does not change filter context. Apply the Equity exclusion inside the &lt;STRONG&gt;Other&lt;/STRONG&gt; measure using CALCULATE() so the logic affects only that branch while leaving the Insurance calculation untouched.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2026 07:42:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Measure-filtering-issue-Excluding-specific-sub-segment/m-p/5271033#M13213</guid>
      <dc:creator>Prince0011</dc:creator>
      <dc:date>2026-07-05T07:42:21Z</dc:date>
    </item>
  </channel>
</rss>

