Forum Discussion
Anonymous
1 year agoNot applicable
dax help
im not able to achieve rolling sum values for below dax test2 = var endmonth = SELECTEDVALUE(W_MCAL_PERIOD_D[MCAL_JULIAN_PERIOD_NUM]) var startmonth = endmonth-11 RETURN CALCULATE(SUM(HR_...
rohit1991
1 year agoSuper User
Here is an improved DAX formula to calculate the rolling sum:
test2 =
VAR CurrentMonth = SELECTEDVALUE(W_MCAL_PERIOD_D[MCAL_JULIAN_PERIOD_NUM])
VAR StartMonth = CurrentMonth - 11
RETURN
CALCULATE(
SUM(HR_FACT[_Terminated Voluntary Employee OHR]),
HR_FACT[Gender] = "Female",
HR_FACT[TERMINATION_REASON] <> "Retirement",
FILTER(
ALL(W_MCAL_PERIOD_D),
W_MCAL_PERIOD_D[MCAL_JULIAN_PERIOD_NUM] >= StartMonth &&
W_MCAL_PERIOD_D[MCAL_JULIAN_PERIOD_NUM] <= CurrentMonth
)
)
- Anonymous1 year agoNot applicable