Forum Discussion
Running / Cumulative Total Resetting Each Month
Hello All
I would like to create a measure that calculates a running total which resets at the beginning of each month.
I am using the following DAX however as you will see it is summing up values from prior periods which is not what I am after:
I shall be grateful if someone can assist.
Many thanks
kc_ , Try using below DAX
RunningTotal =
CALCULATE(
SUM('YourTable'[YourColumn]),
FILTER(
ALL('YourTable'),
'YourTable'[Date] <= MAX('YourTable'[Date]) &&
MONTH('YourTable'[Date]) = MONTH(MAX('YourTable'[Date])) &&
YEAR('YourTable'[Date]) = YEAR(MAX('YourTable'[Date]))
)
)
2 Replies
- bhanu_gautamSuper User
kc_ , Try using below DAX
RunningTotal =
CALCULATE(
SUM('YourTable'[YourColumn]),
FILTER(
ALL('YourTable'),
'YourTable'[Date] <= MAX('YourTable'[Date]) &&
MONTH('YourTable'[Date]) = MONTH(MAX('YourTable'[Date])) &&
YEAR('YourTable'[Date]) = YEAR(MAX('YourTable'[Date]))
)
)- kc_Helper I
Many thanks!