<?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 DAX for rolling 12 month average of previous 12 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-rolling-12-month-average-of-previous-12-months/m-p/3580412#M138092</link>
    <description>&lt;P&gt;I have a dataset with date that I join to a calendar table, which gives me the date, month, week, etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get a 12 month rolling average of sales for the previous 12 months (not counting the current month, so if today is December 12, 2023 I would want the average of the 12 months from December 2022 through November 2023.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using Max Date to get the final date to be the end of the previous month (in this example November 30, 2022) but I can't get an average formula to work..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help is appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 18:33:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-12-12T18:33:28Z</dc:date>
    <item>
      <title>DAX for rolling 12 month average of previous 12 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-rolling-12-month-average-of-previous-12-months/m-p/3580412#M138092</link>
      <description>&lt;P&gt;I have a dataset with date that I join to a calendar table, which gives me the date, month, week, etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get a 12 month rolling average of sales for the previous 12 months (not counting the current month, so if today is December 12, 2023 I would want the average of the 12 months from December 2022 through November 2023.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using Max Date to get the final date to be the end of the previous month (in this example November 30, 2022) but I can't get an average formula to work..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 18:33:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-rolling-12-month-average-of-previous-12-months/m-p/3580412#M138092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-12T18:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for rolling 12 month average of previous 12 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-rolling-12-month-average-of-previous-12-months/m-p/3580732#M138112</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;Calculate the End of the Previous Month&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;EndOfPreviousMonth = 
EOMONTH(TODAY(), -1)
&lt;/LI-CODE&gt;
&lt;P&gt;2.&amp;nbsp;Define the 12-Month Period&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;StartOfPeriod = 
STARTOFMONTH(DATEADD('Date'[Date], -12, MONTH))
&lt;/LI-CODE&gt;
&lt;P&gt;3.&amp;nbsp;Create the Rolling 12-Month Average Measure&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rolling12MonthAvg = 
CALCULATE(
    AVERAGE('Sales'[SalesAmount]),
    DATESBETWEEN(
        'Date'[Date],
        [StartOfPeriod],
        [EndOfPreviousMonth]
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Should you require any further assistance, please do not hesitate to reach out to me.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 22:57:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-rolling-12-month-average-of-previous-12-months/m-p/3580732#M138112</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-12-12T22:57:38Z</dc:date>
    </item>
  </channel>
</rss>

