<?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 Calculated Measure and Percentage is changing when used slicer and filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295731#M170510</link>
    <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the percentage value for the categories against the total value.&lt;/P&gt;&lt;P&gt;DAX formula is working fine but when slicer or filter values are filtered the outpwut is not chnaging and showing as it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using below DAX function&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(RPT_CARBON_UNPIVOT[Value]),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(RPT_CARBON_UNPIVOT[Value]),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;()) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me on this on DAX function for any kind of slicer and filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;M. Vijay Antony&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 21 Nov 2024 17:24:10 GMT</pubDate>
    <dc:creator>VijayAntonyM</dc:creator>
    <dc:date>2024-11-21T17:24:10Z</dc:date>
    <item>
      <title>Calculated Measure and Percentage is changing when used slicer and filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295731#M170510</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the percentage value for the categories against the total value.&lt;/P&gt;&lt;P&gt;DAX formula is working fine but when slicer or filter values are filtered the outpwut is not chnaging and showing as it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using below DAX function&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(RPT_CARBON_UNPIVOT[Value]),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(RPT_CARBON_UNPIVOT[Value]),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;()) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me on this on DAX function for any kind of slicer and filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;M. Vijay Antony&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Nov 2024 17:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295731#M170510</guid>
      <dc:creator>VijayAntonyM</dc:creator>
      <dc:date>2024-11-21T17:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure and Percentage is changing when used slicer and filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295798#M170514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="613755" data-lia-user-login="VijayAntonyM" class="lia-mention lia-mention-user"&gt;VijayAntonyM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that highly depends on the desired outcome. However, changing ALL ( ) to ALLSELECTED ( ) would most probably solve your problem&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 18:01:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295798#M170514</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-11-21T18:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Measure and Percentage is changing when used slicer and filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295929#M170521</link>
      <description>&lt;P&gt;@Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="613755" data-lia-user-login="VijayAntonyM" class="lia-mention lia-mention-user"&gt;VijayAntonyM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue you're experiencing is due to the use of the &lt;CODE&gt;ALL()&lt;/CODE&gt; function in your denominator. The &lt;CODE&gt;ALL()&lt;/CODE&gt; function removes &lt;STRONG&gt;all filters&lt;/STRONG&gt; from your data model, including those applied by slicers and filters in your report. This means the denominator remains constant, and your percentage doesn't change when you apply filters.&lt;/P&gt;
&lt;P&gt;To make your percentage calculation responsive to slicers and filters, you should use &lt;CODE&gt;ALLSELECTED()&lt;/CODE&gt; instead. The &lt;CODE&gt;ALLSELECTED()&lt;/CODE&gt; function keeps the filters applied by slicers and other visuals but removes filters from the current context (like row-level filters in a table or matrix).&lt;/P&gt;
&lt;P&gt;Here's the updated DAX formula:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Percentage =
DIVIDE(
    SUM(RPT_CARBON_UNPIVOT[Value]),
    CALCULATE(
        SUM(RPT_CARBON_UNPIVOT[Value]),
        ALLSELECTED(RPT_CARBON_UNPIVOT)
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Alternate Approach:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you want to remove filters only from specific columns (e.g., category column) and keep others, you can use &lt;CODE&gt;ALL()&lt;/CODE&gt; with specific columns:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Percentage =
DIVIDE(
    SUM(RPT_CARBON_UNPIVOT[Value]),
    CALCULATE(
        SUM(RPT_CARBON_UNPIVOT[Value]),
        ALL(RPT_CARBON_UNPIVOT[CategoryColumn])
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace &lt;CODE&gt;CategoryColumn&lt;/CODE&gt; with the actual name of your category column.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Summary:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Replace &lt;CODE&gt;ALL()&lt;/CODE&gt; with &lt;CODE&gt;ALLSELECTED()&lt;/CODE&gt; to respect slicers and filters.&lt;/LI&gt;
&lt;LI&gt;This adjustment will make your percentage values update dynamically based on any slicers or filters applied.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If this post&lt;STRONG&gt; helps&lt;/STRONG&gt;, please consider &lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;|&lt;A href="https://twitter.com/VahidDMcom" target="_blank" rel="noopener noreferrer"&gt;Twitter&lt;/A&gt;|&lt;A href="https://www.vahiddm.com/" target="_blank" rel="noopener noreferrer"&gt;Blog&amp;nbsp;&lt;/A&gt;|&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;YouTube&lt;/A&gt;&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 20:23:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Measure-and-Percentage-is-changing-when-used-slicer/m-p/4295929#M170521</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2024-11-21T20:23:11Z</dc:date>
    </item>
  </channel>
</rss>

