Others

How to Calculate Total Working Days Across Multiple Date Ranges in Power BI

Ayan MasoodAyan Masood Nov 4, 2026 868 views

Question details

The user needs to calculate the total number of working days across multiple pairs of start and end dates within Power BI.

How to Calculate Total Working Days Across Multiple Date Ranges in Power BI
Product
Power BI
Device & OS
not provided
Scenario
Aggregating working-day durations for multiple activities or projects using DAX functions.
Observed behavior
The user is looking for an efficient way to calculate and sum working days for multiple date ranges using DAX formulas.
Before you start

Ensure your dataset's date fields are correctly formatted as the Date data type in Power BI, and verify that all start dates are chronologically earlier than or equal to their corresponding end dates.

Solution 1Recommended

Use NETWORKDAYS and SUMX DAX Functions

Create a DAX measure or calculated column to compute the working days for each date range, then aggregate them using the SUMX function.

The NETWORKDAYS function in DAX computes the number of working days between two dates, automatically excluding weekends. By wrapping this function in SUMX, you can iterate through your dataset and aggregate the total working days across multiple date range pairs efficiently.

1
Prepare Date Columns

Verify that your dataset has valid 'Start Date' and 'End Date' columns and that their data type is set to Date/Time in the Power BI Data view.

2
Create a Holiday Table (Optional)

If you need to exclude custom holidays from the working day calculation, create a separate one-column table listing the specific holiday dates so it can be referenced in your formula.

3
Write the DAX Measure

Create a new measure using the formula: Total Working Days = SUMX('YourTable', NETWORKDAYS('YourTable'[StartDate], 'YourTable'[EndDate], 1, 'HolidaysTable')).

4
Add to Your Visuals

Drag and drop this new DAX measure into your Power BI reports, matrix, or card visuals to display the aggregated total working days.

Use NETWORKDAYS and SUMX DAX Functions
Date Order Requirement: The NETWORKDAYS function will return a negative number if the start date is later than the end date. Ensure your data is cleaned before applying the DAX measure.
Free Microsoft Office alternative

Simplify Data Analysis with WPS Office

While Power BI offers robust enterprise business intelligence features, complex DAX formulas aren't always necessary for daily analytical tasks. WPS Spreadsheet provides a lightweight, free alternative for comprehensive data aggregation, featuring built-in NETWORKDAYS functions and full compatibility with Microsoft Excel formats.

  1. 1. Open Your Data in WPS Spreadsheet: Import your CSV or Excel dataset containing the start and end dates directly into WPS Spreadsheet.
  2. 2. Apply the NETWORKDAYS Formula: Use the standard =NETWORKDAYS() formula in an adjacent column to calculate working days for individual date ranges.
  3. 3. Sum the Totals: Use the =SUM() function at the bottom of the column to quickly aggregate the total working-day duration across all ranges.
Fully compatible with Microsoft Excel (.xlsx, .xls) and CSV data formats.Intuitive spreadsheet interface for straightforward date and time calculations.Completely free to use with quick installation on Windows, Mac, and Linux.
microsoft office alternative - wps office

Frequently Asked Questions

Does the NETWORKDAYS function automatically exclude weekends?

Yes, the standard NETWORKDAYS function in DAX automatically excludes weekends (Saturday and Sunday) from the total day count. If you need to specify different weekend days, you can use the NETWORKDAYS.INTL function.

Why does my DAX measure return a negative number?

A negative number usually occurs when the start date in your data is chronologically after the end date. Ensure your start dates always precede your end dates to get accurate positive durations.

How do I exclude specific company holidays from my calculation?

You can create a separate table in Power BI containing the dates of your specific company holidays. Pass this table name as the fourth argument in your NETWORKDAYS DAX function to subtract those specific dates from the working day count.