<?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: 12 Month Rolling Cumulative Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057827#M105550</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;thank you so much for your response. I'm so sorry but i don't fully understand your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added a new measure to the file based on what I think is needed but this doesn't give me the right answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain in a bit more detail and perhaps provide a specific solution in the file?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=MCwHmt" target="_blank"&gt;https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=MCwHmt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 12:47:37 GMT</pubDate>
    <dc:creator>Saskwyt</dc:creator>
    <dc:date>2023-02-02T12:47:37Z</dc:date>
    <item>
      <title>12 Month Rolling Cumulative Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057672#M105536</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wondered if someone can help me please? After searching the forum I can't quite find an appropriate answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i'm trying to achieve is a rolling 12 months cumulative sales. So that when I change the "To Date" on the date slicer it automatically looks back 12 months and calculates the cumulative sales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data in the model:&lt;/P&gt;&lt;P&gt;I have a list of orders with dates and values from 2020 to 2023 - This comes from a spreadsheet and is called Excel_Data in the model. I also have a date table which is linked to the Excel_Data table.&lt;/P&gt;&lt;P&gt;I also have a DAX measure called YTD_SALES_CY:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YTD_SALES_CY = 
CALCULATE(Sum(Excel_Data[CompanyNotesCost]),
    FILTER(
        ALL(Date_Table),
        And(Date_Table[Date]&amp;lt;= Max(Date_Table[Date]),
            Date_Table[Date]&amp;gt;eomonth(CALCULATE(MAX(Date_Table[Date]), ALLSELECTED(Date_Table)),-14)
            )
          )
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX measure I have above seems to be pretty close. The issue seems to be with the "From date" as this doesn't change when the "To Date" changes.&lt;BR /&gt;&lt;BR /&gt;In simple terms - When I enter 31/12/2022 as my "To Date" in the slicer, I get 12 months worth of data. When I select 31/01/2023 as my "To Date" I get 13 months of data, 28/02/2023 I get 14 months of data, 30/06/2022 I get 6 months of data. I want to always have 12 months of data looking back from my "To Date"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below a link to my file and many thanks in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=luKJZf" target="_blank"&gt;https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=luKJZf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 11:28:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057672#M105536</guid>
      <dc:creator>Saskwyt</dc:creator>
      <dc:date>2023-02-02T11:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: 12 Month Rolling Cumulative Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057757#M105544</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;For rolling 12M I usually use this kind of structure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT&gt;&lt;FONT class=""&gt;CALCULATE &lt;FONT class=""&gt;( &lt;FONT class=""&gt;selectedmeasure&lt;FONT class=""&gt;()&lt;FONT class=""&gt;, &lt;FONT class=""&gt;DATESBETWEEN &lt;FONT class=""&gt;(&lt;FONT class=""&gt; 'Calendar'[Date], &lt;FONT class=""&gt;DATEADD &lt;FONT class=""&gt;( &lt;FONT class=""&gt;LASTDATE &lt;FONT class=""&gt;( &lt;FONT class=""&gt;DATEADD &lt;FONT class=""&gt;(&lt;FONT class=""&gt; 'Calendar'[Date], -&lt;FONT class=""&gt;12&lt;FONT class=""&gt;, &lt;FONT class=""&gt;MONTH &lt;FONT class=""&gt;) &lt;FONT class=""&gt;)&lt;FONT class=""&gt;, +&lt;FONT class=""&gt;1&lt;FONT class=""&gt;, &lt;FONT class=""&gt;DAY &lt;FONT class=""&gt;)&lt;FONT class=""&gt;, &lt;FONT class=""&gt;LASTDATE &lt;FONT class=""&gt;(&lt;FONT class=""&gt; 'Calendar'[Date] &lt;FONT class=""&gt;) &lt;FONT class=""&gt;) &lt;FONT class=""&gt; )&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT&gt;&lt;BR /&gt;Just place your calculation logic in the "selectedmeasure()" slot.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 12:11:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057757#M105544</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2023-02-02T12:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: 12 Month Rolling Cumulative Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057827#M105550</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;thank you so much for your response. I'm so sorry but i don't fully understand your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added a new measure to the file based on what I think is needed but this doesn't give me the right answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain in a bit more detail and perhaps provide a specific solution in the file?&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=MCwHmt" target="_blank"&gt;https://t4designlimited-my.sharepoint.com/:u:/g/personal/markshort_t4design_com/EVExCE3KLOlAmCKBARpzaJgBAGlaglJX-owGQXP-lCw0wg?e=MCwHmt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 12:47:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/12-Month-Rolling-Cumulative-Sales/m-p/3057827#M105550</guid>
      <dc:creator>Saskwyt</dc:creator>
      <dc:date>2023-02-02T12:47:37Z</dc:date>
    </item>
  </channel>
</rss>

