<?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: Week-To-Date Cumulative Not Resetting Properly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592442#M175878</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="914868" data-lia-user-login="sandy_liew" class="lia-mention lia-mention-user"&gt;sandy_liew&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use windows function with Partition By clause to get this result. Here is the dax for your reference.&lt;/P&gt;
&lt;P&gt;Week_Cumm =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Test_Table[Total_DRR] ),&lt;BR /&gt;WINDOW (&lt;BR /&gt;0,&lt;BR /&gt;ABS,&lt;BR /&gt;0,&lt;BR /&gt;REL,&lt;BR /&gt;ALL ( Test_Table[Finance_Date], Test_Table[Week_1] ),&lt;BR /&gt;ORDERBY ( Test_Table[Finance_Date] ),&lt;BR /&gt;,&lt;BR /&gt;PARTITIONBY ( Test_Table[Week_1] )&lt;BR /&gt;)&lt;BR /&gt;)&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;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Neeraj&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 08:01:19 GMT</pubDate>
    <dc:creator>divyed</dc:creator>
    <dc:date>2025-03-03T08:01:19Z</dc:date>
    <item>
      <title>Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592295#M175874</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi, I have the following DAX logic in order to calculate the cumulative totals by week and reset in the following week, however I observed that the data could cumulate accurately, just that it is not being able to reset every week, for example on 202441, the data was supposed to start back with 515,800 rather than 4,124,687, could anyone here pls help me with this issue?&lt;BR /&gt;&lt;BR /&gt;WTD_DRR_T2_Overall = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; [Total_DRR], &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'), &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;SPAN&gt;WEEKNUM&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'[Finance Date]) = &lt;/SPAN&gt;&lt;SPAN&gt;WEEKNUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'[Finance Date],-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'[Finance Date]) = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'[Finance Date])) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'F-Spec Output'[Finance Date] &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('F-Spec Output'[Finance Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;whereby&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Total_DRR] =&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;T2_DRR_Calendar&lt;/SPAN&gt;&lt;SPAN&gt;[DRR]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;T2_DRR_Calendar&lt;/SPAN&gt;&lt;SPAN&gt;[Factory]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"ATKL"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"KTM"&lt;/SPAN&gt;&lt;SPAN&gt;})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Mar 2025 06:36:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592295#M175874</guid>
      <dc:creator>sandy_liew</dc:creator>
      <dc:date>2025-03-03T06:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592306#M175876</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="914868" data-lia-user-login="sandy_liew" class="lia-mention lia-mention-user"&gt;sandy_liew&lt;/a&gt;&amp;nbsp;, Try using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dax&lt;BR /&gt;WTD_DRR_T2_Overall =&lt;BR /&gt;VAR CurrentWeek = WEEKNUM(MAX('F-Spec Output'[Finance Date]))&lt;BR /&gt;VAR CurrentYear = YEAR(MAX('F-Spec Output'[Finance Date]))&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Total_DRR],&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('F-Spec Output'),&lt;BR /&gt;WEEKNUM('F-Spec Output'[Finance Date]) = CurrentWeek &amp;amp;&amp;amp;&lt;BR /&gt;YEAR('F-Spec Output'[Finance Date]) = CurrentYear &amp;amp;&amp;amp;&lt;BR /&gt;'F-Spec Output'[Finance Date] &amp;lt;= MAX('F-Spec Output'[Finance Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 06:44:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592306#M175876</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-03-03T06:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592320#M175877</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;Hi, I got this as my result after implementing your code, is it possible to modify the code so that it could start cumulating on 9/28/2024 rather than 9/29/2024, need to follow the Week.1&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 06:54:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592320#M175877</guid>
      <dc:creator>sandy_liew</dc:creator>
      <dc:date>2025-03-03T06:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592442#M175878</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="914868" data-lia-user-login="sandy_liew" class="lia-mention lia-mention-user"&gt;sandy_liew&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use windows function with Partition By clause to get this result. Here is the dax for your reference.&lt;/P&gt;
&lt;P&gt;Week_Cumm =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Test_Table[Total_DRR] ),&lt;BR /&gt;WINDOW (&lt;BR /&gt;0,&lt;BR /&gt;ABS,&lt;BR /&gt;0,&lt;BR /&gt;REL,&lt;BR /&gt;ALL ( Test_Table[Finance_Date], Test_Table[Week_1] ),&lt;BR /&gt;ORDERBY ( Test_Table[Finance_Date] ),&lt;BR /&gt;,&lt;BR /&gt;PARTITIONBY ( Test_Table[Week_1] )&lt;BR /&gt;)&lt;BR /&gt;)&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;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Neeraj&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 08:01:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592442#M175878</guid>
      <dc:creator>divyed</dc:creator>
      <dc:date>2025-03-03T08:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592486#M175879</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="826012" data-lia-user-login="divyed" class="lia-mention lia-mention-user"&gt;divyed&lt;/a&gt;&amp;nbsp;, it worked perfectly!!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 08:26:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4592486#M175879</guid>
      <dc:creator>sandy_liew</dc:creator>
      <dc:date>2025-03-03T08:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595840#M175986</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hi, I currently have another DAX logic formula as shown below for Month-to-Date (MTD) cumulative, however it is facing the issue of not following the 202410 month as shown in the "Month" column, supposedly it should not reset on 10/1/2024 but rather it should still continue the cumulation until the "Month" column turn into 202411 in order to reset the MTD calculation&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 03:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595840#M175986</guid>
      <dc:creator>sandy_liew</dc:creator>
      <dc:date>2025-03-05T03:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595841#M175987</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="826012" data-lia-user-login="divyed" class="lia-mention lia-mention-user"&gt;divyed&lt;/a&gt;&amp;nbsp;I tried using your DAX logic formula and change it to partition according to month for Month-To-Date (MTD) cumulative, however it shows the same result as the one you showed me for Week-To-Date (WTD) cumulative, but when I removed the "WW" column, everything will be normal, the thing is it is compulsory for me to show the "WW" column&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 03:23:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595841#M175987</guid>
      <dc:creator>sandy_liew</dc:creator>
      <dc:date>2025-03-05T03:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Week-To-Date Cumulative Not Resetting Properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595946#M175992</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="914868" data-lia-user-login="sandy_liew" class="lia-mention lia-mention-user"&gt;sandy_liew&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please share your dax to check further ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note couple of things in the formula shared:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;ALL ( Test_Table[Finance_Date], Test_Table[Week_1] )&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; you need to add fields here , you should use of relaive fields used in dax either in partition by&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; or order by.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;PARTITIONBY ( Test_Table[Week_1] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; you can pass multiple fields in correct sequence to get desired result.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Warm Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Neeraj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 05:26:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-To-Date-Cumulative-Not-Resetting-Properly/m-p/4595946#M175992</guid>
      <dc:creator>divyed</dc:creator>
      <dc:date>2025-03-05T05:26:05Z</dc:date>
    </item>
  </channel>
</rss>

