Reply
Frequent Visitor
Posts: 10
Registered: ‎12-07-2018

Re: Moving average excluding weekends and holidays

@AlB

 

The table I will use for calculations does not contain weekends or holidays.

AlB Super Contributor
Super Contributor
Posts: 1,185
Registered: ‎11-12-2018

Re: Moving average excluding weekends and holidays

@awilliams91

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.

Frequent Visitor
Posts: 10
Registered: ‎12-07-2018

Re: Moving average excluding weekends and holidays

@AlB

 

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!

AlB Super Contributor
Super Contributor
Posts: 1,185
Registered: ‎11-12-2018

Re: Moving average excluding weekends and holidays

Hi @awilliams91

Have a look at this for a nice explanation on how to do it.

Cheers

Highlighted
Member
Posts: 104
Registered: ‎08-16-2017

Re: Moving average excluding weekends and holidays

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.