Forum Discussion

Lenastray's avatar
Lenastray
Icon for Helper I rankHelper I
6 years ago

Previous dates using date add and switch

Hi,

 

Thanks in advance for the support. The objective is to make a measure that gives the previous aummount for any date, excluding holidays and weekends. I was using the "is holiday" and "is weekend" from the model calendar table to switch between diferents dateadd for some aggregation measure, but it gave error as result.

 

measure := calculate(aggregateMeasure,

switch(TRUE(),

calendar[isHoliday] = 1 and calendar[day] = 5, dateadd(calendar[date], - 4, day),

... //for every use case

but the result is error : /

 

thanks for any help

2 Replies