<?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: Sumx function isn't working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2581779#M74103</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332379" data-lia-user-login="yve214" class="lia-mention lia-mention-user"&gt;yve214&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, please try this code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Iterative Qty =
IF (
    HASONEVALUE ( date[date_dt] ),
    [final Qty],
    SUMX ( VALUES ( date[date_dt] ), [final Qty] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Additionally, please see if this blog helps:&amp;nbsp;&lt;A href="https://theexcelclub.com/learn-how-to-fix-totals-and-subtotals-in-dax-powerbi-and-power-pivot/" target="_blank"&gt;Learn How to Fix Totals and Subtotals in DAX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2022 03:19:24 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-06-16T03:19:24Z</dc:date>
    <item>
      <title>Sumx function isn't working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2576082#M73769</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my sumx function isnt working for a total qty measure i calculated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my Qty measure where I am replacing my empty rows with the previous values as such&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;final Qty =&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR CurrentValue =&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;SUM ( data[qty])&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;VAR PreviousValue =&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;if(&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;sum(data[qty])&amp;nbsp;= BLANK(),&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;CALCULATE(&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;sum(data[qty]),&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;date[date_dt] = MAX(date[date_dt])-1,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;RETURN&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;if(&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;max(date[date_dt]) =max(date[date_dt])&amp;nbsp;,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;CurrentValue + PreviousValue,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;CurrentValue&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When I put this total on my table view, I dont get the iterative total by the dates as I would like to see. It is giving me the total qty logic as if I was jusr doing a sum(qty).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Iterative Qty = sumx(values(date[date_dt]), [final Qty])&amp;nbsp;&lt;/STRONG&gt;(this should add up all the values on the views itself but when I look at it, the rows are correct but the total is still wrong. I had to export it to excel and noticed its not working)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any other way to add my iterative values for my view?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Jun 2022 20:59:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2576082#M73769</guid>
      <dc:creator>yve214</dc:creator>
      <dc:date>2022-06-13T20:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sumx function isn't working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2581779#M74103</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332379" data-lia-user-login="yve214" class="lia-mention lia-mention-user"&gt;yve214&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, please try this code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Iterative Qty =
IF (
    HASONEVALUE ( date[date_dt] ),
    [final Qty],
    SUMX ( VALUES ( date[date_dt] ), [final Qty] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Additionally, please see if this blog helps:&amp;nbsp;&lt;A href="https://theexcelclub.com/learn-how-to-fix-totals-and-subtotals-in-dax-powerbi-and-power-pivot/" target="_blank"&gt;Learn How to Fix Totals and Subtotals in DAX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 03:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2581779#M74103</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-16T03:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sumx function isn't working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2594093#M74816</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332379" data-lia-user-login="yve214" class="lia-mention lia-mention-user"&gt;yve214&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ kalyj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 07:33:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2594093#M74816</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-22T07:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sumx function isn't working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2601124#M75179</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="334520" data-lia-user-login="v-yanjiang-msft" class="lia-mention lia-mention-user"&gt;v-yanjiang-msft&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for ahelping. Unfortunately in this instance it didnt work. Still got the same result but I can see how this will help with every other generic situation so thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 17:23:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sumx-function-isn-t-working/m-p/2601124#M75179</guid>
      <dc:creator>yve214</dc:creator>
      <dc:date>2022-06-24T17:23:05Z</dc:date>
    </item>
  </channel>
</rss>

