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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
bdehning
Post Prodigy
Post Prodigy

Networkdays

I tried using the following but it is one day off due to February 29th this year I beleive.  I got total days of 106 but it should be 107? 

 

WorkingDaysFriSatHolidays =
VAR _holidays = {DATE(2024, 01, 1), DATE(2024, 01, 15), DATE(2024, 05, 27)}

RETURN NETWORKDAYS(DATE(2024, 01, 1), dt"2024-05-31", 7, _holidays)

 

What am I missing?  

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@bdehning Interesting, I'll have to test that. You can always use the old fashioned way: Net Work Days - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@bdehning OK, did some testing. I believe the issue is that you specified 7 in the third parameter meaning that weekends are Friday and Saturday. 5/31/2024 falls on a Friday. See attached PBIX where I did some tests with 2/29/2024 and then Table2 shows an counter in Column 2 for all previous weekdays. It comes out to 109. So that minus 3 is 106



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg,   How do I incorporate my Date of Service Filter

Date of Service =
VAR dte =
DATE(
    INT(isiInspections[DateOfService] / 10000)
    , MOD(INT(isiInspections[DateOfService] / 100), 100)
    , MOD(isiInspections[DateOfService], 100)
)
RETURN
IF(
    dte < TODAY()
    , dte
)

 

So it will control my Card or be a mesure that provides number of working days.

   

Working Days =
VAR _FirstDate = MIN('VW_DATE_DIM'[Date])
Var _LastDate = MAX('VW_DATE_DIM'[Date])
Var _Holidays =CALCULATETABLE(
        DISTINCT('VW_DATE_DIM'[DATE]),
        'VW_DATE_DIM'[ISHOLIDAY] = 1)

RETURN

NETWORKDAYS(
   _FirstDate,
   _LastDate,
    1,
    _Holidays)
 
 

I got close with, but I am off a few days so something is not counting right.  

Working Days =
VAR _FirstDate = MIN('isiInspections'[Date of Service])
Var _LastDate = MAX('isiInspections'[Date of Service])
Var _Holidays =CALCULATETABLE(
        DISTINCT('isiInspections'[Date of Service]),
        'VW_DATE_DIM'[ISHOLIDAY] = 1)

RETURN

NETWORKDAYS(
   _FirstDate,
   _LastDate,
    1,
    _Holidays)
Anonymous
Not applicable

Hi,@bdehning 

Has your problem been solved?

 

If it is solved, please share your solution, which will allow other community members who have the same problem as you to find a solution faster.

 

If not, please share the pbix file except for the sensitive data, and then re-describe your needs, such as start and end dates, the days and days of the week you take off as a week, and the days of vacation in between, and what kind of results you expect. We'll be better suited to help you solve your problems.

 

 

Best Regards,

Leroy Lu

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.