Forum Discussion
ThomasSan
Helper IV
3 years agoHow to count working days between two dates within the same table
Hi everyone, I am attempting to create a measure per row which counts the working days between two days within the same table. To do that, I found the following guide: https://blog.enterprisedna...
- 3 years ago
You're adding it as a measure, not a calculated column, therefore it doesn't have a row context and doesn't know which delivery date or order date to use.
If you use the same code as a calculated column it will work, but since that blog article was published there is now a NETWORKDAYS function in DAX, so you could just use that instead.
Working days column = NETWORKDAYS(Deliveries[Order date], Deliveries[Delivery date])
johnt75
Super User
3 years agoYou're adding it as a measure, not a calculated column, therefore it doesn't have a row context and doesn't know which delivery date or order date to use.
If you use the same code as a calculated column it will work, but since that blog article was published there is now a NETWORKDAYS function in DAX, so you could just use that instead.
Working days column = NETWORKDAYS(Deliveries[Order date], Deliveries[Delivery date])