Forum Discussion
Tony_Singh
3 years agoNew Member
DAX code assistance please:
Hi there please would someone be able to assist with a 14 day rolling average query for a column calculation in PBI, Dates are dd/mm/yy and I have Currency data in the Budget column I am looking to ...
- 3 years ago
My mistake. Somehow I missed to remove the filters.
Rolling Budget = VAR CurrentDate = 'INFEED'[DATE] VAR PreviousDate = CurrentDate - 14 RETURN CALCULATE ( SUM ( INFEED[BUDGET] ), 'INFEED'[DATE] <= CurrentDate, 'INFEED'[DATE] >= PreviousDate, REMOVEFILTERS () )
tamerj1
3 years agoCommunity Champion
Hi Tony_Singh
please try
Rolling Budget =
VAR CurrentDate = 'INFEED'[DATE]
VAR PreviousDate = CurrentDate - 14
RETURN
CALCULATE (
SUM ( INFEED[BUDGET] ),
'INFEED'[DATE] <= CurrentDate,
'INFEED'[DATE] >= PreviousDate
)Tony_Singh
3 years agoNew Member
Hi there, it is only returning the single value ie the pickup value,
In essence we need to aggregate the first 14 days ie 1-14, then 2-15, then 3-16 and so on a bit of a dilema,
Any further suggestions?
Regards,
- tamerj13 years agoCommunity Champion
My mistake. Somehow I missed to remove the filters.
Rolling Budget = VAR CurrentDate = 'INFEED'[DATE] VAR PreviousDate = CurrentDate - 14 RETURN CALCULATE ( SUM ( INFEED[BUDGET] ), 'INFEED'[DATE] <= CurrentDate, 'INFEED'[DATE] >= PreviousDate, REMOVEFILTERS () )