Forum Discussion
cosminc
Post Partisan
7 years agoRolling Average last 2 months data
Hi all, i need to calculate a rolling average from a table but split on a dimension items i tried this: https://community.powerbi.com/t5/Desktop/Rolling-average-on-calculated-table/m-p/693382#M334...
cosminc
Post Partisan
7 years agoanother solution can be something like this:
VAR _current_date = base[Date]
VAR _previous_date = i don't know how to obtain it - is
VAR _Months = { _current_date, _previous_date }
VAR result = CALCULATE(SUM(base[Value]), ALLEXCEPT(base, base[Client]) && base[Date] IN _Months))/
RETURN
result
i don't know how to use those 2 filters and obtain the right expression: ALLEXCEPT(base, base[Client]) && base[Date] IN _Months)
tip: column date has only one value for each year month client (1st of the month)
thanks,
Cosmin