Forum Discussion
Calculating working days
- 5 years ago
v-robertq-msft , I think I've found it!
The date table and workingday column are the samen, but the working days delta has become the following:
as you can see, the one delayed shipment in the overview now gets a positive number. I should be able to use this to measure delayed shipments within a tolerance finally get the performance based on working days! :):):)
Hi Paulus, the problem is probably because your formula for counting working days doesn't properly handle cases where the start or end date doesn't exist in the date table or where both dates are the same. Be sure to use something like this in your calculated column:
DAX
Weekdays =
CALCULATE YOURSELF
COUNTROWS(FilterDates),
FILTER(
'Calendar',
'Calendar'[Date] >= Data[StartDate]
&& 'Calendar'[Date] <= Data[DateEnd]
&& 'Calendar'[IsWorkingDay] = TRUE()
)
)
Replace DateFilter with your date table. It also adds a pre-validation with IF or ISBLANK to handle cases where the dates are equal or null and thus return 0 instead of leaving the value blank.