A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
Here’s how to use the NETWORKDAYS function in Power BI.
Syntax of the NETWORKDAYS function
The syntax of the NETWORKDAYS function is as follows:
NETWORKDAYS(start_date, end_date, [holidays])
- `start_date`: The start date for the calculation.
- `end_date`: The end date for the calculation.
- `[holidays]`: An optional parameter that specifies the dates to exclude from the calculation.
How to use the NETWORKDAYS function
To use the NETWORKDAYS function, follow these steps:
1. Open Power BI and create a new report.
2. Select a visual or create a new one that requires the use of the NETWORKDAYS function.
3. Add a measure to your visual. Click on the "New measure" button in the "Fields" pane.
4. In the formula bar, enter the following formula:
My Measure = NETWORKDAYS([Start Date], [End Date], [Holidays])
5. Replace "My Measure" with the name you want to give your measure.
6. Replace "[Start Date]" and "[End Date]" with the appropriate column names that contain the start and end dates for your calculation.
7. If you need to exclude holidays from your calculation, replace "[Holidays]" with the appropriate column name that contains the list of holidays.
Examples of using the NETWORKDAYS function
Here are a few examples of how to use the NETWORKDAYS function in Power BI.
Example 1: Calculate the number of working days between two dates
Suppose you have a table with two columns, "Start Date" and "End Date," and you want to calculate the number of working days between these two dates. Here's how you can do it using the NETWORKDAYS function:
1. Create a new measure using the formula:
Working Days = NETWORKDAYS([Start Date], [End Date])
2. Add the "Working Days" measure to your visual.
Example 2: Exclude weekends and holidays from the calculation
Suppose you want to exclude weekends and holidays from the calculation of working days between two dates. Here's how you can do it using the NETWORKDAYS function:
1. Create a new measure using the formula:
Working Days = NETWORKDAYS([Start Date], [End Date], Holiday[Date])
2. Add the "Working Days" measure to your visual.
Note: In this example, "Holiday" is the name of the table that contains the list of holidays. "Date" is the name of the column in the "Holiday" table that contains the holiday dates.
The NETWORKDAYS function in Power BI is a powerful tool that can help you calculate the number of working days between two dates, taking into account weekends and holidays. By following the steps outlined in this article, you can easily use this function in your Power BI reports to create accurate project timelines or business schedules.