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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rpinxt
Solution Sage
Solution Sage

Networkdays not working?

Please have a look at this sample data :

CountryDCAF submittedDCAF completedDays to ApproveTest Excel CalcRemark
Saudi Arabia14-08-2415-08-2412 1No weekend
Ukraine13-08-2419-08-2465 6Weekend
Kazakhstan21-03-2426-03-2454 5Weekend
Iraq15-08-2419-08-2443 4Weekend
Bangladesh16-08-24  -32515 -45520x
Russia23-08-2427-08-2443 4Weekend

 

I am trying to exclude weekends between 2 dates.

The field "Days to Approve" is a normal DATEDIFF like :

Days to Approve = DATEDIFF(Tracker[DCAF submitted],Tracker[DCAF completed],DAY)
 
So for the network days I made the field 'Test' en set it up like :
Test = NETWORKDAYS(Tracker[DCAF submitted],Tracker[DCAF completed],1)
 
If you then for instance look at the last line the datediff gives 4 days.
27 -23 Aug is indeed 4 days.
But I would expect the Networkdays to return 2 and not 3....
 
And on the line which has no weekend in the Networkdays does something really strange.
Difference was 1 day without weekend so I would expect networkingdays to also return 1 but here it even adds a day!??
 
Does anybody have an idea where I am going wrong?
 
Only thing I want is to exclude the weekends between 'DCAF submitted' and 'DCAF completed'.
1 ACCEPTED SOLUTION
rpinxt
Solution Sage
Solution Sage

Well thinking a bit more about this I think that it is in the way both dax formulas work:

rpinxt_0-1724832938227.png

If you take the last line and look at DateDiff then you can say 27 -/- 23 is 4 so that is correct.

But if you would count the days it would be 23, 24, 25, 26, 27 so then it would be 5.

 

But Networkdays does not look at the difference but really counts that days.

23, 26 and 27 = 3 days.

 

Therefore I think the formulas work fine.

Just up to me (us) to see what we would need.

The difference in the days or really count the days literally.

 

And I can always do -1 with networkdays if we need to count the days between dates without weekends.

Instead of litteraly counting all the days without weekends.

View solution in original post

5 REPLIES 5
rpinxt
Solution Sage
Solution Sage

Well thinking a bit more about this I think that it is in the way both dax formulas work:

rpinxt_0-1724832938227.png

If you take the last line and look at DateDiff then you can say 27 -/- 23 is 4 so that is correct.

But if you would count the days it would be 23, 24, 25, 26, 27 so then it would be 5.

 

But Networkdays does not look at the difference but really counts that days.

23, 26 and 27 = 3 days.

 

Therefore I think the formulas work fine.

Just up to me (us) to see what we would need.

The difference in the days or really count the days literally.

 

And I can always do -1 with networkdays if we need to count the days between dates without weekends.

Instead of litteraly counting all the days without weekends.

rpinxt
Solution Sage
Solution Sage

@Idrissshatila well I think it is.

 

But you are typing the date in the formula.

What if you copy my sample data in Excel.

And then make the calculated columns like I did.

Do you get the same?

Hello,

 

Idrissshatila_0-1724838561596.png

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Ok so you get the same.

Yes I think it is just how it works.

As explained in previous post we will make it work for us.

Thanks for your replies @Idrissshatila 

Idrissshatila
Super User
Super User

Hello @rpinxt ,

 

weird behaviour you're having here, I tried the networkdays and it shows 3 days 

networkdays = NETWORKDAYS(DATE(2024, 8, 23), DATE(2024, 8, 27),1

Idrissshatila_0-1724830989131.png

and the datediff as well

Idrissshatila_1-1724831116059.png

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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