<?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: Measure for rolling 12 month average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1138150#M17003</link>
    <description>&lt;P&gt;Hi Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&amp;nbsp; That's worked exactly as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brendan&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2020 07:47:03 GMT</pubDate>
    <dc:creator>Bfaws</dc:creator>
    <dc:date>2020-06-03T07:47:03Z</dc:date>
    <item>
      <title>Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135376#M16915</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I`m looking for a measure to calculate average Full time equivalent (FTE) over a 12 month rolling period.&amp;nbsp; I have a table that shows the sum of FTE for each month.&amp;nbsp; What I would like is an additional column which shows the previous 12 month rolling average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see what first table looks like:&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;And this is the expected result:&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;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brendan&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 08:39:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135376#M16915</guid>
      <dc:creator>Bfaws</dc:creator>
      <dc:date>2020-06-02T08:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135536#M16916</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Rolling12month = CALCULATE(    AVERAGE( 'Table'[Sum of FTE]);    DATESINPERIOD( 'Date'[Date]; MAX( 'Date'[Date] ); -12;  MONTH ))&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Power BI file is &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgddqzJmpDOFcRJ7c2Q?e=oant0v" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some tweaking might be needed because the RT needs to be calculated on an aggregate. Pls share detailed data in case this does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 09:22:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135536#M16916</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-02T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135787#M16925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="234635" data-lia-user-login="Bfaws" class="lia-mention lia-mention-user"&gt;Bfaws&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;12monthsRollingAvg = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var _a = MAX('Table'[Report Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _12months = Minx(DATEADD('Table'[Report Date],-12,MONTH),'Table'[Report Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;//To get average of all the report Dates&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//CALCULATE(Average('Table'[Sum of FTE]), Filter(ALL('Table'),'Table'[Report Date] &amp;lt;=_a &amp;amp;&amp;amp; 'Table'[Report Date] &amp;gt; _12months))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;//To get Average Dates where previous data of 12 months is available&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRUE(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CountROWS(FILTER(ALL('Table'),'Table'[Report Date] &amp;lt;=_a &amp;amp;&amp;amp; 'Table'[Report Date] &amp;gt; _12months)) = 12,CALCULATE(Average('Table'[Sum of FTE]), Filter(ALL('Table'),'Table'[Report Date] &amp;lt;=_a &amp;amp;&amp;amp; 'Table'[Report Date] &amp;gt; _12months))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jun 2020 10:50:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1135787#M16925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-02T10:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1137804#M16994</link>
      <description>&lt;P&gt;Hi Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response. I have tried this but dont quite get the result.&amp;nbsp; This is probably my fault though as I think i have over-simplied the information provided.&amp;nbsp; I have set up a pbix file which mirrors the real file in terms of format of data loaded and model structure.&amp;nbsp; Can you please have another look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brendan&lt;/P&gt;&lt;P&gt;&lt;A title="12 Months Rolling.pbix" href="https://1drv.ms/u/s!AtGISPtZ7ajKgQDjcO06sW8SzOPn?e=wHVvjS" target="_self"&gt;https://1drv.ms/u/s!AtGISPtZ7ajKgQDjcO06sW8SzOPn?e=wHVvjS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 06:11:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1137804#M16994</guid>
      <dc:creator>Bfaws</dc:creator>
      <dc:date>2020-06-03T06:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1137991#M16996</link>
      <description>&lt;P&gt;I see,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Rolling12month = 
var v_dates =  DATESINPERIOD( Rolling_Calendar_Lookup[Date]; MAX( Rolling_Calendar_Lookup[Date] ); -12;  MONTH )
return
AVERAGEX(v_dates;[sum FTE])&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Power BI file &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdd4_H0B6jk3d8Al9A?e=cdnci4" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 06:57:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1137991#M16996</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-03T06:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1138150#M17003</link>
      <description>&lt;P&gt;Hi Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&amp;nbsp; That's worked exactly as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brendan&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:47:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/1138150#M17003</guid>
      <dc:creator>Bfaws</dc:creator>
      <dc:date>2020-06-03T07:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for rolling 12 month average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/3436901#M130427</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;Hopefully you're still active. How would I write this so that it ignores my Date slicer and continues to average back past the 1st date shown? For example, in OPs example April 2017 is average as just one month, but I would like to average the 12 months prior to April 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 18:44:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-rolling-12-month-average/m-p/3436901#M130427</guid>
      <dc:creator>mcash</dc:creator>
      <dc:date>2023-09-18T18:44:15Z</dc:date>
    </item>
  </channel>
</rss>

