Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
CiaraCaryl
Frequent Visitor

Number of Workdays per Month

I need to calculate the number of work days per month for some margin and revenue data.

Essentially the invoice date I am using should only include work days, no holidays or weekends. 

What formula can I use that would return the number of distinct invoice dates per month?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @CiaraCaryl ,

If you want to return the working days of the month (excluding weekends and holidays) please see this test.
In my scenario:

My Table:

Table = CALENDAR(DATE(2024,1,1),TODAY())

vyetonggumsft_0-1724642235258.png

workdays =

VAR _start = DATE(YEAR(MAX([Date])), MONTH(MAX([Date])), 1)

VAR _last = EOMONTH(_start, 0)

RETURN

NETWORKDAYS(_start, _last, 1, {DATE(2024, 1, 1), DATE(2024, 12, 31)})

vyetonggumsft_1-1724642235266.png

I set the weekend to Saturday and Sunday, which is represented as 1 in the NETWORKDAYS function.

For more details, you can read related document link:

NETWORKDAYS function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Sunshine Gu

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @CiaraCaryl ,

If you want to return the working days of the month (excluding weekends and holidays) please see this test.
In my scenario:

My Table:

Table = CALENDAR(DATE(2024,1,1),TODAY())

vyetonggumsft_0-1724642235258.png

workdays =

VAR _start = DATE(YEAR(MAX([Date])), MONTH(MAX([Date])), 1)

VAR _last = EOMONTH(_start, 0)

RETURN

NETWORKDAYS(_start, _last, 1, {DATE(2024, 1, 1), DATE(2024, 12, 31)})

vyetonggumsft_1-1724642235266.png

I set the weekend to Saturday and Sunday, which is represented as 1 in the NETWORKDAYS function.

For more details, you can read related document link:

NETWORKDAYS function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Sunshine Gu

ahadkarimi
Solution Specialist
Solution Specialist

Hi @CiaraCaryl , try two measures below, and if you encounter any issues, let me know.

 

Workdays = 
CALCULATE(
    COUNTROWS('InvoiceTable'),
    FILTER(
        'InvoiceTable',
        WEEKDAY('InvoiceTable'[InvoiceDate],2) <= 5 && 
        NOT('InvoiceTable'[InvoiceDate] IN VALUES('HolidayTable'[HolidayDate]))
    )
)
Distinct Workdays per Month = 
CALCULATE(
    DISTINCTCOUNT('InvoiceTable'[InvoiceDate]),
    FILTER(
        'InvoiceTable',
        WEEKDAY('InvoiceTable'[InvoiceDate],2) <= 5 && 
        NOT('InvoiceTable'[InvoiceDate] IN VALUES('HolidayTable'[HolidayDate]))
    )
)

 

 

Did I answer your question?  If so, please mark my post as the solution!✔️
Your Kudos are much appreciated!  Proud to be a Responsive Resident!

lbendlin
Super User
Super User

There is no need to calculate this in Power BI. This data is immutable.  Use an external reference table where you precomputed that stuff once.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.