In this blog, I’ll describe How to use “NetworkDays” Dax Function in Power BI
In Power BI’s DAX language, you can use the NETWORKDAYS function to calculate the number of working days between two dates, excluding weekends and optionally specified holidays.
Syntax: – NETWORKDAYS(<start_date>, <end_date>[, <weekend>, <holidays>])
Step 1:- Pick the visual “Table” Drag the OrderID, OrderDate, ShippedDate, and HolidayList from the field section to the value field.
Step 2:- Calculate the working weekdays with the help of Networkdays function.
No. of working days =
Var start_date= SELECTEDVALUE(Orders[OrderDate])
Var end_date= SELECTEDVALUE(Orders[ShippedDate])
returnNETWORKDAYS(start_date,end_date,1,holiday)
Note: I’ve loaded the Holiday list Table on the Power BI desktop since the holiday parameter requires a column table.
Step 3:- Drag the measure in the Table Visual.
This would return the number of business days, excluding weekends and specified holidays, that passed between the order date and the shipped date.