Forum Discussion
BW617
7 years agoNew Member
Need help after calculating date difference excluding weekends.
So I have a calculation comparing number of working days between two dates. I have a date table and the calculation works just fine. CycleTimexWeekends = CALCULATE(SUM(CalendarTable[WorkingDay]),...
- 7 years ago
Perhaps:
CycleTimexWeekendsCorrected = VAR __cycleTime = CALCULATE(SUM(CalendarTable[WorkingDay]),DATESBETWEEN(CalendarTable[Date],Data[Date_Of_Receipt_Formula],Data[Original_Date_of_Response])) RETURN IF(Data[Date_Of_Receipt_Formula] = Data[Original_Date_of_Response]),0,__cycleTime)
ThaddeusB
7 years agoHelper I
You could just use an If statement:
IF ([Date_Of_Receipt_Formula]=[Original_Date_of_Response], 0, [CycleTimexWeekends])
But are you sure that is actually what you want? All of your example span a weekend, but what about weekday-weekday? Do you want 11/26-11/27 to be counted as 2 days (as your forumula will do)?
- BW6177 years agoNew Member
ahhh, in all of this I forgot about that simple solution, that would work just fine. I'm measuring response to customers, so if the date is the same I would want it to equal 0. thanks for the help!