<?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 Counting positive total over the last 6 months, SUMX not returning the expected result in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3072530#M106709</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been having some trouble finding a DAX solution to my problem, let me expose it.&lt;/P&gt;&lt;P&gt;Before we start, I cannot share any data as its confidential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The objective of this measure is to calculate over the fact table for eachy facility the quantity received over the last 6 months.&lt;/P&gt;&lt;P&gt;If the quantity is positive we flag 1, if not, -1, and then sum up all this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that purpose I created a last 6 month sum, then used a SUMX over a summarized table.&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;But since the fact table has months with no quantities received, the summarized table doesn't show data for those dates.&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;The result expected for the last column should be&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please I need help this is urgent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help !&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 16:50:26 GMT</pubDate>
    <dc:creator>WSeirafi</dc:creator>
    <dc:date>2023-02-09T16:50:26Z</dc:date>
    <item>
      <title>Counting positive total over the last 6 months, SUMX not returning the expected result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3072530#M106709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been having some trouble finding a DAX solution to my problem, let me expose it.&lt;/P&gt;&lt;P&gt;Before we start, I cannot share any data as its confidential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The objective of this measure is to calculate over the fact table for eachy facility the quantity received over the last 6 months.&lt;/P&gt;&lt;P&gt;If the quantity is positive we flag 1, if not, -1, and then sum up all this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that purpose I created a last 6 month sum, then used a SUMX over a summarized table.&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;But since the fact table has months with no quantities received, the summarized table doesn't show data for those dates.&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;The result expected for the last column should be&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please I need help this is urgent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help !&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 16:50:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3072530#M106709</guid>
      <dc:creator>WSeirafi</dc:creator>
      <dc:date>2023-02-09T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Counting positive total over the last 6 months, SUMX not returning the expected result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3072685#M106726</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394056" data-lia-user-login="WSeirafi" class="lia-mention lia-mention-user"&gt;WSeirafi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;VAR T1 =&lt;BR /&gt;VALUES ( DIM_CALENDAR[MONTH_YEAR] )&lt;BR /&gt;VAR T2 =&lt;BR /&gt;CALCULATETABLE ( VALUES ( FACT_SALES[Column1] ), ALL ( DIM_CALENDAR ) )&lt;BR /&gt;VAR T3 =&lt;BR /&gt;CROSSJOIN ( T1, T2 )&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX (&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;T3,&lt;BR /&gt;"AVG",&lt;BR /&gt;VAR maxDate =&lt;BR /&gt;CALCULATE ( MAX ( DIM_CALENDAR[CALENDAR DATE] ) )&lt;BR /&gt;VAR stardate =&lt;BR /&gt;DATE ( YEAR ( maxDate ), MONTH ( maxDate ) - 6, DAY ( maxDate ) )&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( FACT_SALES[Column2] ),&lt;BR /&gt;DATESBETWEEN ( DIM_CALENDAR[CALENDAR_DATE], stardate, maxDate )&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;IF ( NOT ISBLANK ( [AVG] ), IF ( [AVG] &amp;gt;= 0, 1, -1 ), BLANK () )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 17:35:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3072685#M106726</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-09T17:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting positive total over the last 6 months, SUMX not returning the expected result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3074809#M106880</link>
      <description>&lt;P&gt;I think I owe you a beer !&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 14:52:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-positive-total-over-the-last-6-months-SUMX-not/m-p/3074809#M106880</guid>
      <dc:creator>WSeirafi</dc:creator>
      <dc:date>2023-02-10T14:52:24Z</dc:date>
    </item>
  </channel>
</rss>

