<?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: Calculate Accumulative Sum of Sales for 12 months from First Purchase Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1269851#M21374</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; - You should just be able to do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Accumulative 12M Sales =
  VAR __Customer = MAX('Table'[Cust #])
  VAR __FirstOrderDate = MAX('Table'[First Order Date])
  VAR __12MonthsEOM = EOMONTH(__FirstOrderDate,12)
  VAR __12MonthsDate = DATE(YEAR(__12MonthsEOM),MONTH(__12MonthsEOM),DAY(__FirstOrderDate))
RETURN
  SUMX(FILTER(ALL('Table'),[Cust #] = __Customer &amp;amp;&amp;amp; [Order Date] &amp;gt;= __FirstOrderDate &amp;amp;&amp;amp; [Order Date] &amp;lt;= __12MonthsDate),[Subtotal])&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 04 Aug 2020 00:05:00 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-08-04T00:05:00Z</dc:date>
    <item>
      <title>Calculate Accumulative Sum of Sales for 12 months from First Purchase Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1269843#M21370</link>
      <description>&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m fairly new to DAX and I´m trying to add the sales of each customer, cumulative sales, from their First Purchase date in either a Calculated Column or a Calculation, to show it in a table with columns or "buckets" of 12M each, kinda like the attached image.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I´ve been trying but have not been able to show the cumulative sales:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revenue 12 month = CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM('Transaction'[Subtotal]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATESINPERIOD('Transaction'[First Order Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX('Transaction'[First Order Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,+364,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DAY))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Roberto-A06&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 23:52:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1269843#M21370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-03T23:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Accumulative Sum of Sales for 12 months from First Purchase Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1269851#M21374</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; - You should just be able to do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Accumulative 12M Sales =
  VAR __Customer = MAX('Table'[Cust #])
  VAR __FirstOrderDate = MAX('Table'[First Order Date])
  VAR __12MonthsEOM = EOMONTH(__FirstOrderDate,12)
  VAR __12MonthsDate = DATE(YEAR(__12MonthsEOM),MONTH(__12MonthsEOM),DAY(__FirstOrderDate))
RETURN
  SUMX(FILTER(ALL('Table'),[Cust #] = __Customer &amp;amp;&amp;amp; [Order Date] &amp;gt;= __FirstOrderDate &amp;amp;&amp;amp; [Order Date] &amp;lt;= __12MonthsDate),[Subtotal])&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 00:05:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1269851#M21374</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-04T00:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Accumulative Sum of Sales for 12 months from First Purchase Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1270012#M21378</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try like&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],Min(Sales[Sales Date]),12,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a date table&lt;/P&gt;
&lt;P&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer : &lt;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See if my webinar on Time Intelligence can help: &lt;A href="https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184" target="_blank"&gt;https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 02:20:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Accumulative-Sum-of-Sales-for-12-months-from-First/m-p/1270012#M21378</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-04T02:20:17Z</dc:date>
    </item>
  </channel>
</rss>

