<?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-mo, 6-mo, and 12-mo 2 Year Stack Rolling Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-mo-6-mo-and-12-mo-2-Year-Stack-Rolling-Average/m-p/789548#M4468</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble getting an accurate rolling average once the year changes. For instance, if I am looking at a 3-month rolling average from April, I get the correct numbers. However, if I look at the average from March, the numbers are off. I believe it has something to do with the year changing (from March I need to see the previous Feb, Jan, and Dec). The same thing happens with the 6-month and 12-month averages if I am looking at 2 different years.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my formulas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_2YS_3Mo = [M_3Mo TY Running total]/[M_3Mo LLY Running Total]-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_3Mo TY Running Total = CALCULATE (&lt;/SPAN&gt;&lt;SPAN&gt;[TY_Comp_Sales],&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DATESINPERIOD (&lt;/SPAN&gt;&lt;SPAN&gt;Cal_Day[Day_Date],&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;LASTDATE ( PREVIOUSMONTH ( Cal_Day[Day_Date] ) ),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-3,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;)&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;&lt;SPAN&gt;M_3Mo LLY Running Total = CALCULATE (&lt;/SPAN&gt;[LLY_Comp_Sales],&amp;nbsp;DATESINPERIOD (Cal_Day[Day_Date],&amp;nbsp;LASTDATE ( PREVIOUSMONTH ( Cal_Day[Day_Date] ) ),&amp;nbsp;-3,&amp;nbsp;MONTH))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any thoughts would be greatly appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 11 Sep 2019 14:30:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-11T14:30:40Z</dc:date>
    <item>
      <title>3-mo, 6-mo, and 12-mo 2 Year Stack Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-mo-6-mo-and-12-mo-2-Year-Stack-Rolling-Average/m-p/789548#M4468</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble getting an accurate rolling average once the year changes. For instance, if I am looking at a 3-month rolling average from April, I get the correct numbers. However, if I look at the average from March, the numbers are off. I believe it has something to do with the year changing (from March I need to see the previous Feb, Jan, and Dec). The same thing happens with the 6-month and 12-month averages if I am looking at 2 different years.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my formulas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_2YS_3Mo = [M_3Mo TY Running total]/[M_3Mo LLY Running Total]-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_3Mo TY Running Total = CALCULATE (&lt;/SPAN&gt;&lt;SPAN&gt;[TY_Comp_Sales],&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DATESINPERIOD (&lt;/SPAN&gt;&lt;SPAN&gt;Cal_Day[Day_Date],&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;LASTDATE ( PREVIOUSMONTH ( Cal_Day[Day_Date] ) ),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-3,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;)&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;&lt;SPAN&gt;M_3Mo LLY Running Total = CALCULATE (&lt;/SPAN&gt;[LLY_Comp_Sales],&amp;nbsp;DATESINPERIOD (Cal_Day[Day_Date],&amp;nbsp;LASTDATE ( PREVIOUSMONTH ( Cal_Day[Day_Date] ) ),&amp;nbsp;-3,&amp;nbsp;MONTH))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any thoughts would be greatly appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Sep 2019 14:30:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-mo-6-mo-and-12-mo-2-Year-Stack-Rolling-Average/m-p/789548#M4468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-11T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: 3-mo, 6-mo, and 12-mo 2 Year Stack Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-mo-6-mo-and-12-mo-2-Year-Stack-Rolling-Average/m-p/3980975#M154375</link>
      <description>&lt;P&gt;Step 1: Create the Running Totals for 3-Month, 6-Month, and 12-Month Periods&lt;BR /&gt;3-Month Running Total&lt;BR /&gt;M_3Mo_TY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[TY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-3, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;M_3Mo_LLY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[LLY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-3, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;6-Month Running Total&lt;BR /&gt;M_6Mo_TY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[TY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-6, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;M_6Mo_LLY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[LLY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-6, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;12-Month Running Total&lt;BR /&gt;M_12Mo_TY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[TY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-12, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;M_12Mo_LLY_Running_Total = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[LLY_Comp_Sales], &lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;Cal_Day[Day_Date], &lt;BR /&gt;LASTDATE(Cal_Day[Day_Date]), &lt;BR /&gt;-12, &lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;Step 2: Calculate the Rolling Averages&lt;BR /&gt;3-Month Rolling Average&lt;BR /&gt;M_3Mo_Rolling_Avg = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_3Mo_TY_Running_Total], &lt;BR /&gt;3, &lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;6-Month Rolling Average&lt;BR /&gt;M_6Mo_Rolling_Avg = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_6Mo_TY_Running_Total], &lt;BR /&gt;6, &lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;12-Month Rolling Average&lt;BR /&gt;M_12Mo_Rolling_Avg = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_12Mo_TY_Running_Total], &lt;BR /&gt;12, &lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;Step 3: Calculate the Year-Over-Year Change&lt;BR /&gt;3-Month Year-Over-Year Change&lt;BR /&gt;M_2YS_3Mo = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_3Mo_TY_Running_Total] - [M_3Mo_LLY_Running_Total], &lt;BR /&gt;[M_3Mo_LLY_Running_Total], &lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;6-Month Year-Over-Year Change&lt;BR /&gt;M_2YS_6Mo = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_6Mo_TY_Running_Total] - [M_6Mo_LLY_Running_Total], &lt;BR /&gt;[M_6Mo_LLY_Running_Total], &lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;12-Month Year-Over-Year Change&lt;BR /&gt;M_2YS_12Mo = &lt;BR /&gt;DIVIDE(&lt;BR /&gt;[M_12Mo_TY_Running_Total] - [M_12Mo_LLY_Running_Total], &lt;BR /&gt;[M_12Mo_LLY_Running_Total], &lt;BR /&gt;0&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 02:20:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/3-mo-6-mo-and-12-mo-2-Year-Stack-Rolling-Average/m-p/3980975#M154375</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2024-06-08T02:20:34Z</dc:date>
    </item>
  </channel>
</rss>

