<?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 3 month average with year change in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-month-average-with-year-change/m-p/3360383#M126329</link>
    <description>&lt;P&gt;Hi, I am working on a measure to calculate the average of the previous 3 months' sales. I figured this out for months that are all in the same year, then I realized that in January the measure wouldn't work. Currently I calculate 3 measures for Month-1, Month-2, and Month-3, and then add them up and divide by 3 to get the average. Here is what Month-2 looks like (the other 2 measures are the exact same just different offsets of the month):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Month-2 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Query3&lt;/SPAN&gt;&lt;SPAN&gt;[Amt]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())-&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Obviously when the 3 month interval crosses over a new year, this will create an issue. Can someone point me in the right direction on how to cover this exception?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 19:58:49 GMT</pubDate>
    <dc:creator>sjpusat16</dc:creator>
    <dc:date>2023-08-01T19:58:49Z</dc:date>
    <item>
      <title>3 month average with year change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-month-average-with-year-change/m-p/3360383#M126329</link>
      <description>&lt;P&gt;Hi, I am working on a measure to calculate the average of the previous 3 months' sales. I figured this out for months that are all in the same year, then I realized that in January the measure wouldn't work. Currently I calculate 3 measures for Month-1, Month-2, and Month-3, and then add them up and divide by 3 to get the average. Here is what Month-2 looks like (the other 2 measures are the exact same just different offsets of the month):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Month-2 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Query3&lt;/SPAN&gt;&lt;SPAN&gt;[Amt]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())-&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Obviously when the 3 month interval crosses over a new year, this will create an issue. Can someone point me in the right direction on how to cover this exception?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 19:58:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-month-average-with-year-change/m-p/3360383#M126329</guid>
      <dc:creator>sjpusat16</dc:creator>
      <dc:date>2023-08-01T19:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: 3 month average with year change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-month-average-with-year-change/m-p/3361015#M126347</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="597291" data-lia-user-login="sjpusat16" class="lia-mention lia-mention-user"&gt;sjpusat16&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use EDATE dax func.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN class=""&gt;[Month]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN class=""&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(EDATE(TODAY(), -&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RollingCalendar&lt;/SPAN&gt;&lt;SPAN class=""&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN class=""&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(EDATE(TODAY(), -&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;refer to this doc:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/edate-function-dax" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dax/edate-function-dax&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 05:37:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-month-average-with-year-change/m-p/3361015#M126347</guid>
      <dc:creator>rubayatyasmin</dc:creator>
      <dc:date>2023-08-02T05:37:56Z</dc:date>
    </item>
  </channel>
</rss>

