Power BI: Calculate Working Days Between Two Dates


You can use the following syntax in DAX to calculate the number of working days between two dates in Power BI:

Working Days Between = NETWORKDAYS(my_data[Start Date], my_data[End Date])

This particular example creates a new column named Working Days Between that contains the number of working days between the date in the Start Date column of a table and the date in the Start End column.

Not that by default, the NETWORKDAYS function assumes that only Monday-Friday are considered working days.

However, you can specify which days of the week should be considered working days and you can create a custom column that specifies which days should be considered holidays and not counted as working days.

Refer to the NETWORKDAYS documentation page for more details.

The following example shows how to use this function in practice.

Example: How to Calculate Working Days Between Two Dates in Power BI

Suppose we have the following table in Power BI named my_data that contains information on the start date and end date for various tasks at some company:

Suppose that we would like to create a new column that contains the number of working days between the dates in the Start Date and End Date columns.

To do so, click the Table tools tab and then click the New column icon:

Then type the following formula into the formula bar:

Working Days Between = NETWORKDAYS(my_data[Start Date], my_data[End Date])

This will create a new column named Working Days Between that contains the number of working days between the dates in the Start Date and End Date columns:

Power BI calculate working days between two dates

From the output we can see:

  • There are 22 days between 1/1/2024 and 1/30/2024.
  • There is 1 working day between 1/5/2024 and 1/5/2024.
  • There are 5 working days between 1/15/2024 and 1/19/2024.

And so on.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

How to Add Months to Date in Power BI
How to Add Days to Date in Power BI
How to Find Max Date in Power BI

Leave a Reply

Your email address will not be published. Required fields are marked *