How to Use the NETWORKDAYS DAX Function in Power BI

 In this blog, we’ll explore how to use the NETWORKDAYS DAX function in Power BI to calculate the number of working days between two dates, excluding weekends and optionally specified holidays.

What is the NETWORKDAYS Function?

The NETWORKDAYS function in Power BI's DAX language helps calculate business days by excluding weekends and specified holidays from the total days between two dates.

 

Syntax: NETWORKDAYS(<start_date>, <end_date>[, <weekend>, <holidays>])

 

anmolmalviya05_0-1737365437345.png

Steps to Implement NETWORKDAYS in Power BI

Step 1: Create a Table Visual

  • Select the Table visual.
  • Drag the following fields from the dataset into the Values section:
    OrderID
    OrderDate
    ShippedDate
    HolidayList (preloaded with holiday dates).
    anmolmalviya05_1-1737365529259.png

Step 2: Create a Measure for Working Days

Write the DAX measure using the NETWORKDAYS function:


No. of working days =

VAR start_date = SELECTEDVALUE(Orders[OrderDate])

VAR end_date = SELECTEDVALUE(Orders[ShippedDate])

RETURN
NETWORKDAYS(start_date, end_date, 1, HolidayList[HolidayDate])

Note: Ensure the holiday list is loaded as a table in your Power BI model, as the holidays parameter requires a column reference.

anmolmalviya05_2-1737365615675.png

 

Step 3: Add the Measure to the Table Visual

Drag the No. of working days measure into the Table visual.

anmolmalviya05_3-1737365629133.png

 

The output will display the number of business days (excluding weekends and specified holidays) between the order and shipment dates for each record.

 

Conclusion

 

The NETWORKDAYS DAX function simplifies calculating business days, making it a valuable tool for time-sensitive metrics such as delivery times, project schedules, or workforce planning.

 

Best Regards

Anmol Malviya

Data Analyst | Addend Analytics

Comments

Popular posts from this blog

Embedding Power BI Reports in Websites and Applications: A Complete Guide

Import Microsoft Planner Data into Power BI Using Power Automate and SharePoint

Difference between Append and Merge in Power BI