<?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 12 Month Rolling Average (Fiscal Calendar) Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1835977#M39082</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to recreate the following formula from Excel in DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 12 month rolling avergae formula is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=SUM(E81:E133)/SUM(D81:D133)*100000&lt;/P&gt;&lt;P&gt;=SUM(E82:E134)/SUM(D82:D134)*100000&lt;/P&gt;&lt;P&gt;=SUM(E83:E135)/SUM(D83:D135)*100000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column E is Total X&lt;/P&gt;&lt;P&gt;Column D is Total Y&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;So it's basically summing the last 53 rows of the 'Total X' column divided by last 53 rows of 'Total Y' column * 100000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the company calendar which is fiscal periods so cannot use any of the inbuilt date/time intelligence functions or the quick measures. My calendar looks like this:&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;Please could someone explain how I can create the same formula in dax...It's driving me mad!&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 11:29:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-11T11:29:15Z</dc:date>
    <item>
      <title>12 Month Rolling Average (Fiscal Calendar) Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1835977#M39082</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to recreate the following formula from Excel in DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 12 month rolling avergae formula is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=SUM(E81:E133)/SUM(D81:D133)*100000&lt;/P&gt;&lt;P&gt;=SUM(E82:E134)/SUM(D82:D134)*100000&lt;/P&gt;&lt;P&gt;=SUM(E83:E135)/SUM(D83:D135)*100000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column E is Total X&lt;/P&gt;&lt;P&gt;Column D is Total Y&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;So it's basically summing the last 53 rows of the 'Total X' column divided by last 53 rows of 'Total Y' column * 100000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the company calendar which is fiscal periods so cannot use any of the inbuilt date/time intelligence functions or the quick measures. My calendar looks like this:&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;Please could someone explain how I can create the same formula in dax...It's driving me mad!&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 11:29:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1835977#M39082</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-11T11:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: 12 Month Rolling Average (Fiscal Calendar) Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1836290#M39109</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Assuming month are not standard, Create a Rank column in date table on period start or yyyypp&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example rolling measure&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rolling = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Period Rank]&amp;gt;=max('Date'[Period Rank])-12 &amp;amp;&amp;amp; 'Date'[Period Rank]&amp;lt;=max('Date'[Period Rank])) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rolling = CALCULATE(Averagex(Values('Date'[Year period]) ,calculate(sum('order'[Qty]))),filter(ALL('Date'),'Date'[Period Rank]&amp;gt;=max('Date'[Period Rank])-12 &amp;amp;&amp;amp; 'Date'[Period Rank]&amp;lt;=max('Date'[Period Rank])) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Period Rank]=max('Date'[Period Rank])))&lt;BR /&gt;Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Period Rank]=max('Date'[Period Rank])-1))&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 13:50:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1836290#M39109</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-05-11T13:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: 12 Month Rolling Average (Fiscal Calendar) Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1836376#M39112</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;thank you for this, my figure is still not quite matching up with the excel spreadsheet. I think the fact the column is called '12 month AFR rolling average' might be a bit confusing because the calculation is actually using the last 53 weeks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example the 12 month rolling average for W/C 17/01/2021 is 16.3 which is calculated by adding the data starting from W/C 19/01/2020 to W/C 17/01/2021 (53 weeks)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using your first measure the figure I get is 17.0 for W/C 17/01/2021 and the second measure gives 17.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help with this!&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 14:34:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/1836376#M39112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-11T14:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: 12 Month Rolling Average (Fiscal Calendar) Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/2414855#M63755</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , you do have week option in period, check or you can use 364 days etc&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or you can have column like&lt;/P&gt;
&lt;P&gt;new columns &lt;BR /&gt;Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1&lt;BR /&gt;Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)&lt;BR /&gt;Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense) &lt;BR /&gt;OR&lt;BR /&gt;Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use WEEKDAY('Date'[Date],1) for sunday week&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 53 weeks = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]&amp;gt;=max('Date'[Week Rank])-53 &amp;amp;&amp;amp; 'Date'[Week Rank]&amp;lt;=max('Date'[Week Rank])))&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 11:24:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Average-Fiscal-Calendar-Calculation/m-p/2414855#M63755</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-24T11:24:17Z</dc:date>
    </item>
  </channel>
</rss>

