<?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: Rolling Moving Sum issue with Blank Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251677#M119992</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128568" data-lia-user-login="KD13" class="lia-mention lia-mention-user"&gt;KD13&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't use time intelligence functions in my code. They don't seem intelligent to me but seems that this not the case for you. Going along with that I guess DATEADD is not the correct function to use in this case rather you can use DATESINPERIOD like&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Sales[Value] ),&lt;BR /&gt;DATESINPERIOD ( '00 -Calendar'[Date], MAX ( '00 -Calendar'[Date] ), -6, MONTH )&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 17:02:47 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-05-24T17:02:47Z</dc:date>
    <item>
      <title>Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251021#M119961</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to calculate the cumulative sales of last 6 months by product but i'm facing a challenge with the months with no data.&lt;/P&gt;&lt;P&gt;for example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the below table, eventhpugh the 1st product has no sales in March 23 , March 23 value should reflect : March + feb+jan+dec+nov+oct) but instead of this it's showing blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;this is the formula that i'm using and i can't find a way to force the calculation even when some of the months are blank :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last 6 months of sales =C&lt;/SPAN&gt;&lt;SPAN&gt;ALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;SPAN&gt;UM&lt;/SPAN&gt;&lt;SPAN&gt;(Sales&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Value])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;D&lt;/SPAN&gt;&lt;SPAN&gt;ATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;00 -Calendar'[&lt;/SPAN&gt;&lt;SPAN&gt;Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Date],&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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>Wed, 24 May 2023 12:26:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251021#M119961</guid>
      <dc:creator>KD13</dc:creator>
      <dc:date>2023-05-24T12:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251259#M119975</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128568" data-lia-user-login="KD13" class="lia-mention lia-mention-user"&gt;KD13&lt;/a&gt;&amp;nbsp;Hard to say exactly what is going on with the information provided but this may help, you would just use SUMX instead of AVERAGEX.&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="http://youtu.be/TkrHfRFjpSc" data-video-remote-vid="http://youtu.be/TkrHfRFjpSc" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTkrHfRFjpSc%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTkrHfRFjpSc&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTkrHfRFjpSc%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 13:56:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251259#M119975</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-05-24T13:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251295#M119977</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your response but the issue is not solved with the proposed method.&lt;/P&gt;&lt;P&gt;the main challenge is that the Cumulative calculation stops wheneve ther's blank value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the below example :&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the row Sales by month we have the monthly sales.&lt;/P&gt;&lt;P&gt;the the cumulative sales row (in Green) , this is how the Moving 3 months sales should be working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the red row, this is how the current dax is behaving. whenever there's a blank the calculation stops.&lt;/P&gt;&lt;P&gt;the dax i'm using is as follows :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last 6 months of sales =C&lt;/SPAN&gt;&lt;SPAN&gt;ALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;SPAN&gt;UM&lt;/SPAN&gt;&lt;SPAN&gt;(Sales&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Value])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;D&lt;/SPAN&gt;&lt;SPAN&gt;ATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;00 -Calendar'[&lt;/SPAN&gt;&lt;SPAN&gt;Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Date],&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 14:08:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251295#M119977</guid>
      <dc:creator>KD13</dc:creator>
      <dc:date>2023-05-24T14:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251677#M119992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128568" data-lia-user-login="KD13" class="lia-mention lia-mention-user"&gt;KD13&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't use time intelligence functions in my code. They don't seem intelligent to me but seems that this not the case for you. Going along with that I guess DATEADD is not the correct function to use in this case rather you can use DATESINPERIOD like&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Sales[Value] ),&lt;BR /&gt;DATESINPERIOD ( '00 -Calendar'[Date], MAX ( '00 -Calendar'[Date] ), -6, MONTH )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:02:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251677#M119992</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-24T17:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251732#M119993</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128568" data-lia-user-login="KD13" class="lia-mention lia-mention-user"&gt;KD13&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have recently solved a similar issue&lt;BR /&gt;Mine was based on years instead.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Solution I used:&amp;nbsp;&lt;BR /&gt;1. Created a new table containing all years&lt;BR /&gt;2. Connected this table to the main one with a join on the year&lt;BR /&gt;3. Created a Running total from PBI quick measures using the Years column in the new table (so Base Value= [Value you want to show cumulative/running total] &amp;amp; Field = [Years from new column])&lt;BR /&gt;4. Make sure to place your Years/Months column from the NEW table on the chart or table you want to show&lt;BR /&gt;worked like a charm!&lt;BR /&gt;&lt;BR /&gt;Edit: PowerBI will show blank if there are no sales/profit/value in a certain time period, which is very frustrating thinking that logically, it should carry the previous value as you stated in your post.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3251732#M119993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-24T17:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3259270#M120466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128568" data-lia-user-login="KD13" class="lia-mention lia-mention-user"&gt;KD13&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to try code as below to create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 6 months of sales = 
CALCULATE (
    SUM ( Sales[Value] ),
    FILTER (
        ALL ( '00 -Calendar' ),
        '00 -Calendar'[Date] &amp;lt;= MAX ( '00 -Calendar'[Date] )
            &amp;amp;&amp;amp; '00 -Calendar'[Date]
                &amp;gt;= EOMONTH ( MAX ( '00 -Calendar'[Date] ), -6 ) + 1
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;My Sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;00 -Calendar = ADDCOLUMNS(CALENDARAUTO(),"YearMonth",YEAR([Date])*100+MONTH([Date]),"MMM YY",FORMAT([Date],"MMM YY"))&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 09:22:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3259270#M120466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-30T09:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3259584#M120485</link>
      <description>&lt;P&gt;pervious month sales =&lt;BR /&gt;VAR maxdate = MAX(Date tablename)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(SUM(Sales),DATESINPERIOD(Date tablename,'Date'[date],-6,MONTH),'Date'[date]&amp;lt;=maxdate)&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 11:43:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3259584#M120485</guid>
      <dc:creator>devanshi</dc:creator>
      <dc:date>2023-05-30T11:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Moving Sum issue with Blank Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3438577#M130524</link>
      <description>&lt;P&gt;THanks for your response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;the only issue with your solution is that eventhough the last month of sales is March 2023 the last 6 monts of sales calculation goes until August 2023 while it mus end at last real month of sales (March 2023)&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>Tue, 19 Sep 2023 16:16:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Moving-Sum-issue-with-Blank-Values/m-p/3438577#M130524</guid>
      <dc:creator>KD13</dc:creator>
      <dc:date>2023-09-19T16:16:46Z</dc:date>
    </item>
  </channel>
</rss>

