Forum Discussion
Anonymous
6 years agoNot applicable
Problem with Moving Average 12
Hi. I have an issue. I was trying to replicate the formula from this post: https://community.powerbi.com/t5/Desktop/5-Day-Moving-average-No-Weekends-in-Data-and-how-I-skip-weekends/m-p/133197#M56...
CNENFRNL
6 years agoCommunity Champion
Hi, there
Weekends are supposed to be filtered out in Tecnicos[FECHA] column beforehand;
or filter down Tecnicos[FECHA] if it contains all consecutive dates
_12workdays =
TOPN (
12,
CALCULATETABLE (
VALUES ( Calendar[Date] ),
NOT WEEKDAY ( Calendar[Date] ) IN { 1, 7 },
FILTER ( ALL ( Calendar[Date] ), Calendar[Date] <= MAX ( Calendar[Date] ) )
)
)
Anonymous
6 years agoNot applicable
Hi.
Thank you for your answer.
The column FECHA that contains dates just have dates from monday to friday, however in the calculation is taking weekends as well (I Think because I'm using DATESINPERIOD).
- Greg_Deckler6 years agoCommunity Champion
Anonymous - Can you just use this?
https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/160720#M3