<?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 average last 3 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940320#M9997</link>
    <description>&lt;P&gt;Excellent Ulf, that solved it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2020 08:30:27 GMT</pubDate>
    <dc:creator>jayjay0306</dc:creator>
    <dc:date>2020-02-20T08:30:27Z</dc:date>
    <item>
      <title>Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/936915#M9825</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I hope you can help me with a shallange:&lt;BR /&gt;I have a Power BI report, where I need to make a measure (I don't have access to the source table) which calculates the rolling average for the last 3 months.&lt;BR /&gt;And the rolling average shall be made on the sum per month (not rolling on the date value).&lt;BR /&gt;Example:&lt;BR /&gt;in the table below, I have the "Daily Sales-Sum per month" in 2019. The datasource is one table (not a datamodel with dimensions and facts), where leaf-level is transactions by date.&lt;BR /&gt;I need the rolling average on the monthly sum-values.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have tried to make the measure (please see below), but the result is wrong(table above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX-Script:&lt;/P&gt;&lt;P&gt;--------------------------------------&lt;BR /&gt;Rolling Average 3 months =&lt;BR /&gt;VAR LastDate_ = LASTDATE(Table[Calendar Day])&lt;BR /&gt;RETURN&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;'Table'[Calendar Day];&lt;BR /&gt;LastDate_; -3; MONTH);&lt;BR /&gt;SUMX(&lt;BR /&gt;KEEPFILTERS(VALUES('Table'[Month]));&lt;BR /&gt;CALCULATE(SUM('Table'[Sales]))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result I need is this (here shown for the last two months, as an example):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? All inputs will be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;JayJay&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 09:13:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/936915#M9825</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2020-02-18T09:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/937141#M9838</link>
      <description>&lt;P&gt;I wrote this, Rolling Months Quick Measure:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Months/m-p/391499#M124" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Months/m-p/391499#M124&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if that doesn't work, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 11:23:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/937141#M9838</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-02-18T11:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938544#M9901</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Rolling Average 3 months =
VAR LastDate_ =
    LASTDATE ( Table[Calendar Day] )
RETURN
    CALCULATE (
        AVERAGEX ( VALUES ( 'Table'[Month] ); CALCULATE ( SUM ( 'Table'[Sales] ) ) );
        FILTER (
            ALL ( Table );
            [Calendar Day] &amp;lt;= LastDate_
                &amp;amp;&amp;amp; [Calendar Day] &amp;gt; DATEADD ( LastDate_; -3; MONTH )
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar to yours, but i changed the table for AVERAGEX to iterate over to the month values. Also changed the calcualte filter a little bit.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 08:59:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938544#M9901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-19T08:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938785#M9913</link>
      <description>&lt;P&gt;Hi Ulf,&lt;/P&gt;&lt;P&gt;Brilliant! it works. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;The only remark I have is, that the rolling average doesn't react to the filters I have in the PBI report.&lt;/P&gt;&lt;P&gt;The value "Table[Sales]" is part of you calculation, but if I fx.filter on "Sales area" the "Sales" per month respond accordingly, but the rolling average remains the same. I find this a bit strange.&lt;/P&gt;&lt;P&gt;Can you tell me why?any ideas?&lt;/P&gt;&lt;P&gt;Thanks anyway.&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Jakob&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 11:33:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938785#M9913</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2020-02-19T11:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938874#M9918</link>
      <description>&lt;P&gt;Yes, it's because of ALL(Table) in the filter. All filters are removed to be able to access previous months. It should be possible to modify the CALCULATE / FILTER expression to only remove the filters on date/year/month. To do that easier and better I suggest creating a connected date table instead of having the date columns in the "fact" table. Dimensional models are usually easier to work with in Power BI! Then you can do the same thing as now but on the date table&amp;nbsp; - ALL([NewDateTable]) instead of ALL(Table).&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 12:30:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/938874#M9918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-19T12:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940320#M9997</link>
      <description>&lt;P&gt;Excellent Ulf, that solved it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 08:30:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940320#M9997</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2020-02-20T08:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940323#M9998</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;thanks for your input. much appreciated. The solution didn't quite solve my problem, but I got wiser on DAX. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 08:33:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940323#M9998</guid>
      <dc:creator>jayjay0306</dc:creator>
      <dc:date>2020-02-20T08:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940782#M10014</link>
      <description>&lt;P&gt;Good to hear the problem is solved! By the way, you should mark my answer as the answer, not your own post... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 12:23:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/940782#M10014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-20T12:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1628585#M32961</link>
      <description>&lt;P&gt;Hi, I have similar issue, I tried to modify you DAX but I have received circular error, could you help to solve it? I have changed first line after FILTER because I need to calculate rolling 3months average per Plant. My&amp;nbsp;column Date, contains "real" date dd/mm/yyyy, (first day of each month)&lt;/P&gt;&lt;P&gt;3MonthsRollingAverage =&lt;/P&gt;&lt;P&gt;VAR LastDate_ =&lt;/P&gt;&lt;P&gt;LASTDATE ( COGSTotal[Date])&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;/P&gt;&lt;P&gt;AVERAGEX ( VALUES (COGSTotal[Date]), CALCULATE ( SUM ( COGSTotal[Total COGS] ) ) ),&lt;/P&gt;&lt;P&gt;FILTER (&lt;/P&gt;&lt;P&gt;COGSTotal,&lt;/P&gt;&lt;P&gt;COGSTotal[Plant]=EARLIER(COGSTotal[Plant]) &amp;amp;&lt;/P&gt;&lt;P&gt;[Date] &amp;lt;= LastDate_&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp; [Date] &amp;gt; DATEADD ( LastDate_, -3, MONTH )) )&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 10:07:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1628585#M32961</guid>
      <dc:creator>arutsjak90</dc:creator>
      <dc:date>2021-01-28T10:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1714861#M35417</link>
      <description>&lt;P&gt;I am not having any luck with this formula.&amp;nbsp; It keeps erroring out on me and I can't figure out where I am going wrong.&amp;nbsp; Trying to do 3-month rolling (hopefully dynamic) average.&amp;nbsp; For month 2021-02, 3 month average should be 15.3%&amp;nbsp; Can provide more data if needed.&amp;nbsp; Any help or direction would be welcomed.&amp;nbsp; Thanks!&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 22:08:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1714861#M35417</guid>
      <dc:creator>WallyWallWal</dc:creator>
      <dc:date>2021-03-10T22:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1963268#M43001</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;what if I have a separate Date Table separate from my Facts Table?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 05:47:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1963268#M43001</guid>
      <dc:creator>jytech</dc:creator>
      <dc:date>2021-07-17T05:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1963908#M43045</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="235827" data-lia-user-login="jytech" class="lia-mention lia-mention-user"&gt;jytech&lt;/a&gt;, it should be the same as long as you have set up a relationship between the tables. This is the preferred way to set up the model. Then filter the date table instead of the fact table in the measure.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Jul 2021 09:19:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/1963908#M43045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-18T09:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2507455#M69460</link>
      <description>&lt;P&gt;I am struggling with the same issue. Do you have a solution yet?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 10:25:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2507455#M69460</guid>
      <dc:creator>EVIJ</dc:creator>
      <dc:date>2022-05-11T10:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2508532#M69535</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="138321" data-lia-user-login="EVIJ" class="lia-mention lia-mention-user"&gt;EVIJ&lt;/a&gt;&amp;nbsp;I ended up having to ask a coworker who has a brain that works like magic.&amp;nbsp; He suggested creating a CTE that joins the date table to itself.&amp;nbsp; Below is the code.&amp;nbsp; Not sure if this will help, but maybe it will give you some insight.&amp;nbsp; It did work for my purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;WITH ABC AS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;SELECT &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;[SurveyCompletedOn]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, case when [Answer] = 'Not at all likely - 0' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '1' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '2' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '3' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '4' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '5' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '6' then 'Detractor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '7' then 'Passive'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '8' then 'Passive'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = '9' then 'Promotor'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;when [Answer] = 'Extremely likely - 10' then 'Promotor' &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;end as 'NPS Scoring'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, ROW_NUMBER()OVER (ORDER BY [SurveyCompletedOn]) AS LINE&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FROM [Database]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;WHERE [Question] LIKE @SURVEY_QUESTION &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;and [SurveyCompletedOn] is not null&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, NUMBER2 AS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;SELECT&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;CONVERT(VARCHAR(7),DATEADD(MONTH,-2,ABC1.SurveyCompletedOn),23) AS '3 MONTH BEGIN'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, CONVERT(VARCHAR(7),ABC1.SurveyCompletedOn,23) AS '3 MONTH END'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, ABC2.[NPS SCORING] AS 'NPS SCORING'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, COUNT(DISTINCT(ABC2.[LINE])) AS 'SCORING'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FROM ABC AS ABC1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp; &amp;nbsp; LEFT JOIN ABC AS ABC2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ON CONVERT(VARCHAR(7),ABC2.SurveyCompletedOn,23) BETWEEN CONVERT(VARCHAR(7),DATEADD(MONTH,-2,ABC1.SurveyCompletedOn),23) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AND CONVERT(VARCHAR(7),ABC1.SurveyCompletedOn,23)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;GROUP BY &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp; &amp;nbsp;CONVERT(VARCHAR(7),DATEADD(MONTH,-2,ABC1.SurveyCompletedOn),23)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, CONVERT(VARCHAR(7),ABC1.SurveyCompletedOn,23)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, ABC2.[NPS Scoring]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;SELECT&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;NUM2.[3 MONTH END]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, SUM(CASE WHEN NUM2.[NPS SCORING] = 'PROMOTOR' THEN NUM2.SCORING ELSE NULL END) AS 'PROMOTOR'&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, SUM(CASE WHEN NUM2.[NPS SCORING] = 'DETRACTOR' THEN NUM2.SCORING ELSE NULL END) AS 'DETRACTOR'&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, CONVERT(NUMERIC(18,2),SUM(CASE WHEN NUM2.[NPS SCORING] = 'PROMOTOR' THEN NUM2.SCORING ELSE NULL END)) / (SUM(NUM2.SCORING)) AS 'PROMOTER 3MTH PERCENT'--&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;, CONVERT(NUMERIC(18,2),SUM(CASE WHEN NUM2.[NPS SCORING] = 'DETRACTOR' THEN NUM2.SCORING ELSE NULL END)) / (SUM(NUM2.SCORING)) AS 'DETRACTOR 3MTH PERCENT'--&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;,(CONVERT(NUMERIC(18,2),SUM(CASE WHEN NUM2.[NPS SCORING] = 'PROMOTOR' THEN NUM2.SCORING ELSE NULL END)) / (SUM(NUM2.SCORING)) - CONVERT(NUMERIC(18,2),SUM(CASE WHEN NUM2.[NPS SCORING] = 'DETRACTOR' THEN NUM2.SCORING ELSE NULL END)) / (SUM(NUM2.SCORING))) AS 'NPS ROLLING 3-MONTH AVERAGE PERCENTAGE' --&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;FROM NUMBER2 NUM2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;GROUP BY&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;NUM2.[3 MONTH END]&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 18:33:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2508532#M69535</guid>
      <dc:creator>WallyWallWal</dc:creator>
      <dc:date>2022-05-11T18:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2597742#M75013</link>
      <description>&lt;P&gt;The Semicolons in the formula should be commas if you're working on it in America. Different syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 13:10:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/2597742#M75013</guid>
      <dc:creator>JLincoln</dc:creator>
      <dc:date>2022-06-23T13:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/4126775#M163872</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;i m using dax for rolling avg 3 month and that gets is result&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total sales &lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;MA =&lt;/SPAN&gt; &lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WINDOW&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;/SPAN&gt;&lt;SPAN&gt;[NR MONTHS &amp;nbsp;Value]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;REL&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;REL&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Month Number]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ORDERBY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ASC&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;dimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ASC&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/SPAN&gt;&lt;SPAN&gt;[TOTAL SALES]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Aug 2024 10:15:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-months/m-p/4126775#M163872</guid>
      <dc:creator>yash09</dc:creator>
      <dc:date>2024-08-30T10:15:38Z</dc:date>
    </item>
  </channel>
</rss>

