<?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: Trying to understand usage/logic of SUMX (outcome is illogical) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2032256#M45577</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;Thank you so much. I was searching for an example online for "SUMX multiple filters", and only found examples up to 2 filters, so I lost a confidence.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 12:37:22 GMT</pubDate>
    <dc:creator>justindoh</dc:creator>
    <dc:date>2021-08-23T12:37:22Z</dc:date>
    <item>
      <title>Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030465#M45524</link>
      <description>&lt;P&gt;I am sharing my &lt;A href="https://drive.google.com/file/d/1x1caJQ0Nyn4zNUPqk_X1z4jDxhYRnQ45/view?usp=sharing" target="_self"&gt;Pbix file here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I am trying to understand about "SUMX" in general (because somebody suggested to use it), but I am not sure how it works. I got the impression that SUMX &lt;U&gt;counts all occurrence/evaluation in the row context&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I decided to use "SUMX" because I have cases where I have to make the outcome as &lt;STRONG&gt;""&lt;/STRONG&gt;, and if I do not use SUMX, Total comes out to be "" in Maxtrix, and that is not it should look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on measures called "&lt;SPAN&gt;Step1_0821" &amp;amp; "&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;Step1 0821 SUMX&lt;/STRONG&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;According to the logic, it should generate &lt;STRONG&gt;1&lt;/STRONG&gt; in both"Step1_0821" &amp;amp; &lt;STRONG&gt;"Step1 0821 SUMX"&lt;/STRONG&gt;, but on&amp;nbsp;&lt;STRONG&gt;"Step1 0821 SUMX"&lt;/STRONG&gt;, the outcome is 2, and that is why I am trying to get a feedback from the community.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If I understand the flow of logic correctly in this case, the logic did not meet the requirement for &lt;STRONG&gt;vNotEligible, &lt;/STRONG&gt;so it goes to the final choice option, &lt;STRONG&gt;Step1&lt;/STRONG&gt;, for the outcome of 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, with the logic of Step1, it should generate only 1 row for&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Step1 0821 SUMX&lt;/STRONG&gt;&lt;/SPAN&gt; or I am writing the DAX formula correctly.&lt;/P&gt;&lt;P&gt;Where am I missing the logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me. Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 15:50:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030465#M45524</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-22T15:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030481#M45528</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;Sorry, I don't see SUMX in your formulas? Reasons to use SUMX. SUMX accepts a table expression as the first parameter so you can filter it however you please and then SUMX takes the second parameter, evaluates the expression for each row of the table and then sums the results together. You can see the difference between SUMX and CALCULATE. Take a simple table like below:&lt;/P&gt;
&lt;P&gt;ItemQuantityValue&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;One&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Two&lt;/TD&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Three&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the following measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sumx1 = SUMX(FILTER('Items',[Item]&amp;lt;&amp;gt;"Two"),[Quantity]*[Value])

Caculate1 = CALCULATE(SUM('Items'[Quantity])*SUM('Items'[Value]),'Items'[Item]&amp;lt;&amp;gt;"Two")&lt;/LI-CODE&gt;
&lt;P&gt;SUMX returns the correct answer 425 while CALCULATE returns the wrong answer 625. SUMX got the right answer because it evaluated at the row level, 5*5 + 20*20. CALCULATE got it wrong because it calculated (20 + 5) * (20 + 5).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 15:53:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030481#M45528</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-22T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030506#M45529</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;Thank you for your feedback. I was using SUMX calling measure "&lt;SPAN&gt;Step1_0821" like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So, you suggest to use SUMX on this area directly?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 16:31:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030506#M45529</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-22T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030561#M45530</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;Right, in general you either use CALCULATE or SUMX. When you mix the two you could definitely get some odd results.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 18:01:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2030561#M45530</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-22T18:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2031114#M45545</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;Thank you so much. I am getting close to make this work.&lt;/P&gt;&lt;P&gt;When I tried with two criteria within filter, it would not give me error.&lt;/P&gt;&lt;P&gt;But when I tried with more than two, it would not let me, but gives me an error.&lt;/P&gt;&lt;P&gt;Do I go about doing this?&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;</description>
      <pubDate>Mon, 23 Aug 2021 04:26:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2031114#M45545</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2021-08-23T04:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2031887#M45568</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;Your NOT(ISBLANK is missing a closing paren. Should be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOT(ISBLANK(Table1[Consent])&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:58:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2031887#M45568</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-23T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to understand usage/logic of SUMX (outcome is illogical)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2032256#M45577</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;Thank you so much. I was searching for an example online for "SUMX multiple filters", and only found examples up to 2 filters, so I lost a confidence.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 12:37:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-understand-usage-logic-of-SUMX-outcome-is-illogical/m-p/2032256#M45577</guid>
      <dc:creator>justindoh</dc:creator>
      <dc:date>2021-08-23T12:37:22Z</dc:date>
    </item>
  </channel>
</rss>

