Forum Discussion
datedif Function, only for working days (mon-Fri)
- 8 years ago
Did you use a disconnected table?
BachFel i would create a flag for the working days, ie a new column calls isworkingday = 1
and then use that in your calculation
can u please show an example?
- vanessafvg8 years agoCommunity Champion
BachFel do you have a date table?
- BachFel8 years agoHelper II
- vanessafvg8 years agoCommunity Champion
BachFel there is possibly a better way to do this but what i would do is then create a day of week column
Date =
ADDCOLUMNS (
CALENDAR(2015-01-01,2018-01-01),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"Day of Week", FORMAT([Date],"dddd"))then create calculated column that is called IsWorkingDay ( you could do a an if statement too)
IsWorkingDay=
SWITCH (
TRUE (),
'Date'[Day of Week] = "Saturday", 0,
'Date'[Day of Week] = "Sunday", 0,
1
)then you will need to add the isworkingday to your calculation, not sure what you are working out below, is there a reason you not using the datediff function?
Tage_seit_erster_Objektbegung = if(KontElemente[Datum der Besichtigung]<>BLANK();TODAY()-KontElemente[Datum der Besichtigung].[Date];BLANK())