Excel has a NETWORKDAYS function that calculates the number of days between two dates minus weekends and holidays. While DAX has a DATEDIFF function that calculates the number of days between two dates, the DATEDIFF function does not account for subtracting weekends and holidays. This recipe is a recreation of Excel's NETWORKDAYS function in DAX.
Replacing Excel's NETWORKDAYS function
Getting ready
To prepare for this recipe, perform the following steps:
- Use an Enter Data query to create a table called R10_Table with the following columns and rows:
Created Date |
Finished Date |
11/17/2019 |
12/29/2019 |
12/15/2019 |
1/13/2020 |
1/12/2020 |
3/30/2020 |
- Ensure that both columns are set to have a data...