<?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 3 months Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1753676#M36596</link>
    <description>&lt;P&gt;Thanks for the hint! Edited previous advise.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 07:08:35 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2021-03-30T07:08:35Z</dc:date>
    <item>
      <title>Rolling 3 months Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1746592#M36332</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encounter an issue on my report and need your help.&lt;/P&gt;&lt;P&gt;I need a calculation of Trend and it's definition is:&lt;/P&gt;&lt;P&gt;Average of the last 3 months of the month selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my slicer is selected for example:&lt;/P&gt;&lt;P&gt;Jan/2021 the Average should be from Nov/2020 + Dec/2020 + Jan/2021(Blue selection)&lt;/P&gt;&lt;P&gt;Feb/2021 the Average should be from Dec/2020 + Jan/2021 + Feb/2021 (Orange selection)&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;My slicer of the month comes from my COD_Calendar table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my data table has data from 01/2020 till 02/2021&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help me with these&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 21:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1746592#M36332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-25T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 months Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1747522#M36346</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try a measure like this with help from date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1),-3,MONTH))&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 09:17:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1747522#M36346</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-26T09:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 months Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1747837#M36357</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;To get the average value for the last 3 months (starting from the chosen one in slicer), you'll need to have a proper calendar table (including dates for 2020 and 2021 upon the example) and the next measure:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;EDITED&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;upon the next comment&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Trend = 
IF(HASONEVALUE(Calendar[Date]),
    CALCULATE(
        AVERAGE(DataTable[Value]),
        DATESINPERIOD(
            Calendar[Date],
            SELECTEDVALUE(Calendar[Date]),
            -3, MONTH)
    ), 
    AVERAGE(DataTable[Value]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 07:10:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1747837#M36357</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2021-03-30T07:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 months Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1752904#M36583</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your usage of the time-intel functions is incorrect and will often yield wrong values. Please refer to this guide to understand when you can correctly use them:&amp;nbsp;&lt;A href="https://dax.guide/datesinperiod/" target="_blank" rel="noopener"&gt;DATESINPERIOD – DAX Guide&lt;/A&gt;. A hint would be: &lt;STRONG&gt;You cannot use time-intel functions with fact tables&lt;/STRONG&gt;. You have to have a proper date/calendar table (dimension) to be safe.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 22:40:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1752904#M36583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-29T22:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 3 months Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1753676#M36596</link>
      <description>&lt;P&gt;Thanks for the hint! Edited previous advise.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 07:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-3-months-Average/m-p/1753676#M36596</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2021-03-30T07:08:35Z</dc:date>
    </item>
  </channel>
</rss>

