Forum Discussion
Anonymous
2 years agoNot applicable
Tableau WINDOW_AVG function in Power BI
Hi All, I am trying to rebuild a series of dashboards from Tableau to PowerBI. One of the calculations I have come across is: WINDOW_AVG(COUNT([Event Description])/AVG([Turbines]), -2, 0) ...
rajendraongole1
2 years agoSuper User
Hi Anonymous -calculate the moving average over the last 3 periods (including the current period) as below:
Moving_Avg_Event_Count =
AVERAGEX(
FILTER(
ALLSELECTED('Faults'),
'Faults'[Date] >= MAX('Faults'[Date]) - 2 &&
'Faults'[Date] <= MAX('Faults'[Date])
),
CALCULATE(COUNT('Faults'[Event Description]) / COUNT('Faults'[Turbines]))
)
Hope it works
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!