<?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 to calculate current and previous year cumulative sales on monthly basis in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4373127#M173615</link>
    <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912628" data-lia-user-login="gabcass" class="lia-mention lia-mention-user"&gt;gabcass&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Any update on this? Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 07:39:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-21T07:39:45Z</dc:date>
    <item>
      <title>Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4363789#M173246</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to calculate the cumulative sales for the current year and also the previous year, with the ability to filter the data by year through a slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling because when the slicer is set for 2025, I can't display the previous year's sales for all months.&lt;/P&gt;&lt;P&gt;The following measure is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cumulative Sales Previous Year = CALCULATE(TOTALYTD([Sales], DATEADD(DimDate[Date], -365, DAY)))&lt;/P&gt;&lt;P&gt;My data model has a date table connected to a sales table via the date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I display the previous year's cumulative sales for all months when the slicer is filtering for the current year?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 18:37:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4363789#M173246</guid>
      <dc:creator>gabcass</dc:creator>
      <dc:date>2025-01-14T18:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4363982#M173253</link>
      <description>&lt;P&gt;You need to add another filter.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Sales Previous Year =
CALCULATE (
    [Sales],
    SAMEPERIODLASTYEAR ( DimDate[Date] ),
    DimDate[Date] &amp;lt;= EDATE ( TODAY (), -12 )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 22:07:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4363982#M173253</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-14T22:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364320#M173258</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912628" data-lia-user-login="gabcass" class="lia-mention lia-mention-user"&gt;gabcass&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can create two separeate measures&lt;BR /&gt;Cumulative Sales Current Year =&lt;BR /&gt;TOTALYTD(&lt;BR /&gt;[Sales],&lt;BR /&gt;DimDate[Date]&lt;BR /&gt;)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cumulative Sales Previous Year =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;TOTALYTD(&lt;BR /&gt;[Sales],&lt;BR /&gt;DimDate[Date]&lt;BR /&gt;),&lt;BR /&gt;SAMEPERIODLASTYEAR(DimDate[Date])&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Use both in the visual&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 04:35:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364320#M173258</guid>
      <dc:creator>govind_021</dc:creator>
      <dc:date>2025-01-15T04:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364422#M173262</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912628" data-lia-user-login="gabcass" class="lia-mention lia-mention-user"&gt;gabcass&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;If these also don't help, please share more detailed information and description to help us clarify your scenario to test.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 06:20:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364422#M173262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-15T06:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364968#M173301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="821086" data-lia-user-login="govind_021" class="lia-mention lia-mention-user"&gt;govind_021&lt;/a&gt;,&amp;nbsp;thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that I have a slicer for year. The measure you suggested works well if I select previous years in my slicer:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if I select 2025 the visual displays data for January only:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and this is OK for the current year, since we are in January, but actually I'd like the visual to display the previous year sales across all months, even if I'm slicing it for 2025.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea about how can I solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 11:35:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364968#M173301</guid>
      <dc:creator>GabeCass</dc:creator>
      <dc:date>2025-01-15T11:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364992#M173302</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;, thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure you suggested gives returns the cumulative sales in the previous year in this exact date.&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;My goal here is to display the current and previous year cumulative sales across all months, regardless of the year I'm slicing, like the image below:&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;But for 2025 as well.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clue on how can I achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 11:46:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4364992#M173302</guid>
      <dc:creator>GabeCass</dc:creator>
      <dc:date>2025-01-15T11:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365522#M173332</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;The issue might not be the DAX, as the previous answers look OK. Are you sure that in your report context you actually have all dates for 2025? It might be that your date dimension does not have dates beyond today or that there is another filter active that filters out dates beyond today.&amp;nbsp; If that's the case then that would cause SAMEPERIODLASTYEAR and comparable solutions to not work.&lt;BR /&gt;You can test that by creating dummy measure that returns a fixed value and adding that to the visual. It should return that value for each month.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 16:54:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365522#M173332</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-01-15T16:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365533#M173337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226664" data-lia-user-login="sjoerdvn" class="lia-mention lia-mention-user"&gt;sjoerdvn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I don't have all dates for 2025 beyond today in my date dimention. I'll include them and test if the recommended measures work. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 17:02:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365533#M173337</guid>
      <dc:creator>GabeCass</dc:creator>
      <dc:date>2025-01-15T17:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365775#M173347</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 20:50:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4365775#M173347</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-15T20:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4373127#M173615</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="912628" data-lia-user-login="gabcass" class="lia-mention lia-mention-user"&gt;gabcass&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Any update on this? Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 07:39:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4373127#M173615</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-21T07:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to calculate current and previous year cumulative sales on monthly basis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4373602#M173644</link>
      <description>&lt;P&gt;DAX (&lt;SPAN&gt;CALENDAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2023&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2025&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;31&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The table is marked as as date table:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Dim Date&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;DateWithSales&lt;/TD&gt;&lt;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/01/2025&lt;/TD&gt;&lt;TD&gt;400402&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1,268.00&lt;/TD&gt;&lt;TD&gt;2537.50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;There is a one-to-many relationship between DimDate[Date] and FactSales[OrderDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Report View, there is a dropdown slicer for Date[Year] set for single selection:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Goal:&lt;/P&gt;&lt;P&gt;I want to project two line charts:&lt;/P&gt;&lt;P&gt;One displaying current year and previous year monthly sales;&lt;/P&gt;&lt;P&gt;One displaying current year and previous year cumulative monthly sales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional Details:&lt;/P&gt;&lt;P&gt;I am referring as the current year as the year set in the slicer, therefore according to the year selected I expect the charts to be updated automatically.&lt;/P&gt;&lt;P&gt;When slicing 2025, I don't want to display current year's sales for further months later to today's date as $0, having the line related to current year's sales displayed up to today's date month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measures Used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Sales (measure used to compute current year sales and to calculate the other measures) =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_Sales&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'FactSales'&lt;/SPAN&gt;&lt;SPAN&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;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Total Sales]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Considering the scenario above, I've almost completed my goal, with the exception that in both charts I'm still displaying current year's monthly sales as zero for months later to today's date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any work around for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.: I'm not being able to select accept any answer as a solution. Could you explain me how can I do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 12:18:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-calculate-current-and-previous-year-cumulative-sales/m-p/4373602#M173644</guid>
      <dc:creator>GabeCass</dc:creator>
      <dc:date>2025-01-21T12:18:16Z</dc:date>
    </item>
  </channel>
</rss>

