Forum Discussion
Moving average excluding weekends and holidays
Not a problem, thank you for the help so far!
So the sales table that I listed in the first example, with the screenshot, does not include weekends or holidays. Essentially, I'm trying to find a way to do a moving average from a specific date and the four prior entries for a particular group. Hopefully this helps and clarifies. Let me know if you have any other questions.
Anonymous
Ok but what I am asking about is the real table that you will use in your calculations.Let's forget about the example shown.
The "real" table has entries on weekends and holidays?
- AlexisOlson7 years ago
Super User
That's an interesting approach, but you have to be careful generalizing it. Indexing the workdays is a good idea, but I'd recommend doing the indexing on your dedicated date table rather than trying to deal with ranking duplicate dates in your fact table.
Another approach would be to use the TOPN function as I suggested here.
- Anonymous7 years agoNot applicable
- AlB7 years ago
Community Champion
Anonymous
Ok so I got it all wrong from the beginning then.
But if it's so, what is the problem?? you just take the last five dates present in the table from the date in the current row. You do not have to skip anything then.
- Anonymous7 years agoNot applicable
I guess your right. How would I go about doing that within DAX? Is there an expression I'm missing here, or just a total mental block?
Thanks!