NETWORKDAYS

Updated on

NETWORKDAYS is a DAX function that returns the number of whole workdays between two dates, excluding weekends and specified holidays.

Syntax

NETWORKDAYS(
   start_date,
   end_date,
   weekend,
   holidays
)
Argument Properties Description
start_date A date that represents the start date.
end_date A date that represents the end date.
weekend Optional Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number that specifies when weekends occur. Weekend number values indicate the following weekend days: 1 or omitted: Saturday, Sunday; 2: Sunday, Monday; 3: Monday, Tuesday; 4: Tuesday, Wednesday; 5; Wednesday, Thursday; 6: Thursday, Friday; 7: Friday, Saturday; 11: Sunday only; 12: Monday only; 13: Tuesday only; 14: Wednesday only; 15: Thursday only; 16: Friday only; 17: Saturday only.
holidays Optional A single column table of one or more dates that are to be excluded from the working day calendar.

Return Values

An integer number of whole workdays.

Remarks

  • This DAX function is similar to Excel NETWORKDAYS.INTL and NETWORKDAYS functions.

  • If start_date and end_date both are BLANK, the output value is also BLANK.

  • If either start_date or end_date is BLANK, the BLANK start_date or end_date will be treated as Date(1899, 12, 30).

  • Dates must be specified by using DATE function or as the result of another expression. For example, DATE ( 2022, 5, 30 ), specifies May 30th, 2022. Dates can also be specified as a literal in format, (dt”2022-05-30”). Do not specify dates as text.

Example

The following expression:

   = NETWORKDAYS (
        DATE ( 2022, 5, 28 ),
        DATE ( 2022, 5, 30 ),
        1,
        {
            DATE ( 2022, 5, 30 )
        }
    )

Returns:

[Value]
0

In this example, 0 is returned because the start date is a Saturday and the end date is a Monday. The weekend parameter specifies that the weekend is Saturday and Sunday, so those are not work days. The holiday parameter marks the 30th (the end date) as a holiday, so no working days remain.

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/networkdays-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy