<?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 Calculating average 12 month average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832310#M184580</link>
    <description>&lt;P&gt;Hi Commnity&lt;BR /&gt;&lt;BR /&gt;I am seeking help to dynamically calculate average amount always for 12 months back. It needs to start from last month and then go 11 months back, meaning when currently in September, then the 12 month period should calculate average from August 2025 - September 2024. Start of next month it needs to start with September and so on.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, im not sure if this is useful information but i have a fiscal year slicer in my report, but it needs to ignore the filter context on that one.&lt;BR /&gt;&lt;BR /&gt;Is there anyone who can come up with a sample code on how they would write the DAX for this.&lt;BR /&gt;&lt;BR /&gt;Thank you in advance&lt;/P&gt;</description>
    <pubDate>Mon, 22 Sep 2025 12:12:11 GMT</pubDate>
    <dc:creator>Nicpet0</dc:creator>
    <dc:date>2025-09-22T12:12:11Z</dc:date>
    <item>
      <title>Calculating average 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832310#M184580</link>
      <description>&lt;P&gt;Hi Commnity&lt;BR /&gt;&lt;BR /&gt;I am seeking help to dynamically calculate average amount always for 12 months back. It needs to start from last month and then go 11 months back, meaning when currently in September, then the 12 month period should calculate average from August 2025 - September 2024. Start of next month it needs to start with September and so on.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, im not sure if this is useful information but i have a fiscal year slicer in my report, but it needs to ignore the filter context on that one.&lt;BR /&gt;&lt;BR /&gt;Is there anyone who can come up with a sample code on how they would write the DAX for this.&lt;BR /&gt;&lt;BR /&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2025 12:12:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832310#M184580</guid>
      <dc:creator>Nicpet0</dc:creator>
      <dc:date>2025-09-22T12:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832313#M184581</link>
      <description>&lt;P&gt;You could create a measure like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;12 month rolling average =
VAR EndDate =
    EOMONTH ( TODAY (), -1 )
VAR StartDate =
    EOMONTH ( TODAY (), -13 ) + 1
VAR Months =
    CALCULATETABLE (
        VALUES ( 'Date'[Year Month] ),
        DATESBETWEEN ( 'Date'[Date], StartDate, EndDate )
    )
VAR Result =
    AVERAGEX (
        Months,
        CALCULATE ( [Measure to average], REMOVEFILTERS ( 'Date'[Fiscal Year] ) )
    )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Sep 2025 12:20:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832313#M184581</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-09-22T12:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832419#M184585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When a fiscal year slicer (or any date filter) is active, time-intelligence measures can be evaluated over a truncated window. That is why a “last 12 months” average can come out wrong or vary with slicers. The fix is to 1) anchor the period to the last &lt;EM&gt;complete&lt;/EM&gt; month and 2) explicitly filter the calculation to the previous 12 months while &lt;STRONG&gt;removing&lt;/STRONG&gt; the slicer’s date filters.&lt;/P&gt;&lt;H3&gt;Quick solution: fixed last 12 months average (ignores FY slicer)&lt;/H3&gt;&lt;P&gt;Assumptions: you have a proper Date table marked as a date table, with a daily [Date] column; [Amount] is your base measure (SUM, etc.).&lt;/P&gt;&lt;PRE&gt;Avg 12M (last complete month) :=&lt;BR /&gt;VAR Anchor = EOMONTH( TODAY(), -1 ) -- last day of the previous month&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE(&lt;BR /&gt;    CALCULATE(&lt;BR /&gt;        [Amount],&lt;BR /&gt;        REMOVEFILTERS ( 'Date' ), -- ignore fiscal year/date slicers&lt;BR /&gt;        DATESINPERIOD ( 'Date'[Date], Anchor, -12, MONTH )&lt;BR /&gt;    ),&lt;BR /&gt;    12&lt;BR /&gt;)&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;EOMONTH finds the last complete month boundary (&lt;A href="https://learn.microsoft.com/en-us/dax/eomonth-function-dax" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;).&lt;/LI&gt;&lt;LI&gt;DATESINPERIOD builds exactly 12 months back from that anchor (&lt;A href="https://learn.microsoft.com/en-us/dax/datesinperiod-function-dax" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;).&lt;/LI&gt;&lt;LI&gt;REMOVEFILTERS clears the Date table’s filter context so FY slicers do not interfere (&lt;A href="https://learn.microsoft.com/en-us/dax/removefilters-function-dax" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;).&lt;/LI&gt;&lt;LI&gt;DIVIDE safely divides by 12 (&lt;A href="https://learn.microsoft.com/en-us/dax/divide-function-dax" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2025 13:49:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4832419#M184585</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-22T13:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4833250#M184606</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="566246" data-lia-user-login="Nicpet0" class="lia-mention lia-mention-user"&gt;Nicpet0&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;!-- StartFragment  --&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1340679" data-lia-user-login="tayloramy" class="lia-mention lia-mention-user"&gt;tayloramy&lt;/a&gt;&amp;nbsp;&amp;nbsp;and&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp; for the response provided!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Thank you for your understanding!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;!-- EndFragment  --&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 10:03:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-12-month-average/m-p/4833250#M184606</guid>
      <dc:creator>v-tejrama</dc:creator>
      <dc:date>2025-09-23T10:03:32Z</dc:date>
    </item>
  </channel>
</rss>

