Forum Discussion
Anonymous
7 years agoNot applicable
DATEDIFF working days between 2 dates
Hey all, I've followed the "DATEDIFF Working Days" instructions for calculate the working days. In fact, I have a table with all the days and a "1" in the saturdays, sundays and holidays ("0" on ...
- 7 years ago
Greg_Deckler
Community Champion
7 years agoNo, you should just have to add them in one place. I used a DATATABLE in the measure, just so that everything was contained in the measure itself. In practice, I would expect that you would have a separate table of holidays and you would just load that into the holidays var like this:
NetWorkDaysHolidays = VAR Calendar1 = CALENDAR(MAX(NetWorkDays[created date]),MAX(NetWorkDays[review date])) VAR Holidays1 = 'HolidayTable' VAR Calendar2 = EXCEPT(Calendar1,Holidays1) VAR Calendar3 = ADDCOLUMNS(Calendar2,"WeekDay",WEEKDAY([Date],2)) RETURN COUNTX(FILTER(Calendar3,[WeekDay]<6),[Date])
In this case, you would have a table called "HolidayTable".
Anonymous
7 years agoNot applicable
Hi again Greg,
I followed your instructions but Powerbi doesn't find the table. It seems I have to write a measure in "VAR Holidays1 =" but the table with all the dates are not allowed:
Regards