<?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: Add columns to ALLEXCEPT formula only if the columns are filtered in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4124275#M163767</link>
    <description>&lt;P&gt;Thank You, but do You know another way? Because I would need to add more to ALLEXCEPT because I have several filters on dimarticle, if I would use ISFILETERED that would mean lots of conditions&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 06:38:01 GMT</pubDate>
    <dc:creator>Natalia10000</dc:creator>
    <dc:date>2024-08-29T06:38:01Z</dc:date>
    <item>
      <title>Add columns to ALLEXCEPT formula only if the columns are filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4123186#M163717</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following measure&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;PercentageofTotal2 =&lt;/DIV&gt;&lt;DIV&gt;var TotalKPI = CALCULATE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Calculation KPI],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLEXCEPT(dimarticle,dimarticle[MerchandiseCategoryACGDesc],dimarticle[ProductAllocation]))&lt;/DIV&gt;&lt;DIV&gt;RETURN&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;DIVIDE([Calculation KPI],TotalKPI)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would like to add additional columns from table dimarticle to ALLEXCEPT but only if the user will filter them, so e.g.&amp;nbsp; there is slicer dimarticle[Category], so if the user filters sth in this slicer, the formula should look like that:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;PercentageofTotal2 =&lt;/DIV&gt;&lt;DIV&gt;var TotalKPI = CALCULATE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Calculation KPI],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ALLEXCEPT(dimarticle,dimarticle[MerchandiseCategoryACGDesc],dimarticle[ProductAllocation],&lt;STRONG&gt;dimarticle[Category]&lt;/STRONG&gt;))&lt;/DIV&gt;&lt;DIV&gt;RETURN&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;DIVIDE([Calculation KPI],TotalKPI)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could You please help me with that?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Kind reagrds,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Natalia&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Aug 2024 15:58:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4123186#M163717</guid>
      <dc:creator>Natalia10000</dc:creator>
      <dc:date>2024-08-28T15:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns to ALLEXCEPT formula only if the columns are filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4123782#M163746</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="615387" data-lia-user-login="Natalia10000" class="lia-mention lia-mention-user"&gt;Natalia10000&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use &lt;A href="https://dax.guide/isfiltered/" target="_self"&gt;ISFILTERED&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://dax.guide/isfiltered/" target="_self"&gt;function&lt;/A&gt; to check if a column is being filtered.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PercentageofTotal2 =
VAR TotalKPI1 =
    CALCULATE (
        [Calculation KPI],
        ALLEXCEPT (
            dimarticle,
            dimarticle[MerchandiseCategoryACGDesc],
            dimarticle[ProductAllocation]
        )
    )
VAR _1 =
    DIVIDE ( [Calculation KPI], TotalKPI1 )
VAR TotalKPI2 =
    CALCULATE (
        [Calculation KPI],
        ALLEXCEPT (
            dimarticle,
            dimarticle[MerchandiseCategoryACGDesc],
            dimarticle[ProductAllocation],
            dimarticle[Category]
        )
    )
VAR _2 =
    DIVIDE ( [Calculation KPI], TotalKPI2 )
RETURN
    IF ( ISFILTERED ( dimarticle[Category] ), _2, _1 )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution &lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 01:37:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4123782#M163746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-29T01:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns to ALLEXCEPT formula only if the columns are filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4124275#M163767</link>
      <description>&lt;P&gt;Thank You, but do You know another way? Because I would need to add more to ALLEXCEPT because I have several filters on dimarticle, if I would use ISFILETERED that would mean lots of conditions&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 06:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4124275#M163767</guid>
      <dc:creator>Natalia10000</dc:creator>
      <dc:date>2024-08-29T06:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns to ALLEXCEPT formula only if the columns are filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4124520#M163772</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="615387" data-lia-user-login="Natalia10000" class="lia-mention lia-mention-user"&gt;Natalia10000&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I understand what you mean, but there is no way to dynamically add parameters to ALLEXCEPT, the method in reply 2 is an alternative. Or you could consider the &lt;A href="https://learn.microsoft.com/en-us/dax/allselected-function-dax" target="_self"&gt;ALLSELECTED function&lt;/A&gt; and see if it achieves your desired result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PercentageofTotal2 =
var TotalKPI = CALCULATE(
                    [Calculation KPI],
                    ALLSELECTED(dimarticle))
RETURN
 DIVIDE([Calculation KPI],TotalKPI)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 07:59:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-columns-to-ALLEXCEPT-formula-only-if-the-columns-are/m-p/4124520#M163772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-29T07:59:36Z</dc:date>
    </item>
  </channel>
</rss>

