Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
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>])
Step 1: Create a Table Visual
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.
Step 3: Add the Measure to the Table Visual
Drag the No. of working days measure into the Table visual.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.