<?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 cumulative monthly total separate by different years in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3462282#M132073</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you so much for the detailed explanation and example! One thing I noticed is that when we use 'filter' combined with 'All', it seems that other slicers don't seem to be functioning. Is there a way to have slicers (eg. product type) to still be applicable?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 17:52:44 GMT</pubDate>
    <dc:creator>gabrielmission7</dc:creator>
    <dc:date>2023-10-05T17:52:44Z</dc:date>
    <item>
      <title>Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3451039#M131460</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;I'm trying to calculate monthly total of revenues but the current month's total is added on top of the previous months. Also, I'd like to separate total by years. Using below table example, I'm hoping to get the outcome in Total2 column but someone I'm getting Total1 (in other words, I'd like the cumulative sum to reset in each year).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Table Sales&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Revenue&lt;/TD&gt;&lt;TD&gt;Total1&lt;/TD&gt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]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Sep 2023 05:53:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3451039#M131460</guid>
      <dc:creator>gabrielmission7</dc:creator>
      <dc:date>2023-09-28T05:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3451082#M131463</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="537794" data-lia-user-login="gabrielmission7" class="lia-mention lia-mention-user"&gt;gabrielmission7&lt;/a&gt;&amp;nbsp;for monthly amounts per year, you will need TOTALMTD (link below) as possible solution&lt;/P&gt;&lt;P&gt;Measure test MTD= TOTALMTD(SUM('Sales'[Revenue]]),YourCalendar[DateKey])&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adjust according your table / column name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you do not have already calendar table create one as below and connect relationship with your table&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables" target="_self"&gt;https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TOTALMTD&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/totalmtd-function-dax?WT.mc_id=DP-MVP-4025372" target="_self"&gt;https://learn.microsoft.com/en-us/dax/totalmtd-function-dax?WT.mc_id=DP-MVP-4025372&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TOTALYTD (when you have MTD, usually YTD is pair)&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/totalytd-function-dax?WT.mc_id=DP-MVP-4025372" target="_self"&gt;https://learn.microsoft.com/en-us/dax/totalytd-function-dax?WT.mc_id=DP-MVP-4025372&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure test yTD= TOTALYTD(SUM('Sales'[Revenue]]),YourCalendar[DateKey])&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did I answer your question? Kudos appreciated / accept solution!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 06:30:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3451082#M131463</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-09-28T06:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452139#M131531</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the reply. However, YTD and MTD are probably not what I'm looking for. Essentially, I'm trying to pull this kind of graph that shows cumulative sum of sales but separate by year.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 17:12:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452139#M131531</guid>
      <dc:creator>gabrielmission7</dc:creator>
      <dc:date>2023-09-28T17:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452273#M131538</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;, further to my earlier comment, I think YTD is the right thing to do. However, for some reason, the outcome is not summing up. Any thoughts? Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 18:49:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452273#M131538</guid>
      <dc:creator>gabrielmission7</dc:creator>
      <dc:date>2023-09-28T18:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452368#M131539</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="537794" data-lia-user-login="gabrielmission7" class="lia-mention lia-mention-user"&gt;gabrielmission7&lt;/a&gt;&amp;nbsp;in initial post you wrote&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cumulative sum to reset in each year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is YTD. Dou yoz have ćcalendar/Date table connected with yourtable?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 20:06:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3452368#M131539</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-09-28T20:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3455521#M131712</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="537794" data-lia-user-login="gabrielmission7" class="lia-mention lia-mention-user"&gt;gabrielmission7&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you have an exact date column like "YYYY/MM/DD" in your data, such as the following:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is a date column, you can use Way1:&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Way1 =
SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&amp;amp;&amp;amp;'Table'[Date]&amp;lt;=MAX('Table'[Date])),[Revenue])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If there is no date column, try Way2:&lt;/P&gt;
&lt;P&gt;1. In Power Query -- Add Column – Index Column – From 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create a calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Text =
SUMMARIZE(
    'Table','Table'[Year],'Table'[Month],    "Index",MINX(FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])&amp;amp;&amp;amp;'Table'[Month]=EARLIER('Table'[Month])),[Index]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Way2_value =
SUMX(
    FILTER(ALL('Table'),
    'Table'[Year]=MAX('Text'[Year])&amp;amp;&amp;amp;'Table'[Month]=MAX('Text'[Month])),[Revenue])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Way2_sumvalue =
SUMX(
    FILTER(ALL('Text'),
    'Text'[Year]=MAX('Text'[Year])&amp;amp;&amp;amp;'Text'[Index]&amp;lt;=MAX('Text'[Index])),[Way2_value])&lt;/LI-CODE&gt;
&lt;P&gt;4. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 06:46:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3455521#M131712</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-02T06:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3462282#M132073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you so much for the detailed explanation and example! One thing I noticed is that when we use 'filter' combined with 'All', it seems that other slicers don't seem to be functioning. Is there a way to have slicers (eg. product type) to still be applicable?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 17:52:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3462282#M132073</guid>
      <dc:creator>gabrielmission7</dc:creator>
      <dc:date>2023-10-05T17:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate cumulative monthly total separate by different years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3462616#M132093</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I solved the issue by replacing the 'All' function with 'Allexcept'. Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 21:14:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-cumulative-monthly-total-separate-by-different-years/m-p/3462616#M132093</guid>
      <dc:creator>gabrielmission7</dc:creator>
      <dc:date>2023-10-05T21:14:50Z</dc:date>
    </item>
  </channel>
</rss>

