Forum Discussion
sandy_liew
1 year agoFrequent Visitor
Week-To-Date Cumulative Not Resetting Properly
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 no...
- 1 year ago
Hello sandy_liew ,
You can use windows function with Partition By clause to get this result. Here is the dax for your reference.
Week_Cumm =
CALCULATE (
SUM ( Test_Table[Total_DRR] ),
WINDOW (
0,
ABS,
0,
REL,
ALL ( Test_Table[Finance_Date], Test_Table[Week_1] ),
ORDERBY ( Test_Table[Finance_Date] ),
,
PARTITIONBY ( Test_Table[Week_1] )
)
)I hope this helps.
Warm Regards,
Neeraj
- 1 year ago
Thank you divyed , it worked perfectly!!
sandy_liew
1 year agoFrequent Visitor
bhanu_gautam 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