<?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 rolling 3 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-3-months/m-p/1362419#M27888</link>
    <description>&lt;P&gt;I need help with setting up my DAX to only calculate the last 3 rolling average months.&amp;nbsp; This is what I have so far:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling Avg Price = AVERAGEX(FILTER(ALLSELECTED(vwInvoices[Month]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;vwInvoices[Month] &amp;lt;= MAX(vwInvoices[Month])), CALCULATE(SUM(vwInvoices[Price])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;any help is greatly appreciated!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 10 Sep 2020 18:43:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-10T18:43:10Z</dc:date>
    <item>
      <title>rolling 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-3-months/m-p/1362419#M27888</link>
      <description>&lt;P&gt;I need help with setting up my DAX to only calculate the last 3 rolling average months.&amp;nbsp; This is what I have so far:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling Avg Price = AVERAGEX(FILTER(ALLSELECTED(vwInvoices[Month]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;vwInvoices[Month] &amp;lt;= MAX(vwInvoices[Month])), CALCULATE(SUM(vwInvoices[Price])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;any help is greatly appreciated!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Sep 2020 18:43:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-3-months/m-p/1362419#M27888</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-10T18:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: rolling 3 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-3-months/m-p/1470603#M27915</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , With a date table, try a formula like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(AVERAGE(vwInvoices[Price]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH)) &lt;BR /&gt;Rolling 3 = CALCULATE(AVERAGE(vwInvoices[Price]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-3,MONTH)) &lt;BR /&gt;Rolling 3 = CALCULATE(AVERAGE(vwInvoices[Price]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or sum them and divide by 3&lt;/P&gt;
&lt;P&gt;or sum and divide by distinct months&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(vwInvoices[Price]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))/3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = Divide( CALCULATE(sum(vwInvoices[Price]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH)) ,&lt;/P&gt;
&lt;P&gt;CALCULATE(distinctcount(Date[Month Year]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 02:28:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/rolling-3-months/m-p/1470603#M27915</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-03T02:28:13Z</dc:date>
    </item>
  </channel>
</rss>

