Forum Discussion
Networkdays not working?
Please have a look at this sample data :
| Country | DCAF submitted | DCAF completed | Days to Approve | Test | Excel Calc | Remark | |
| Saudi Arabia | 14-08-24 | 15-08-24 | 1 | 2 | 1 | No weekend | |
| Ukraine | 13-08-24 | 19-08-24 | 6 | 5 | 6 | Weekend | |
| Kazakhstan | 21-03-24 | 26-03-24 | 5 | 4 | 5 | Weekend | |
| Iraq | 15-08-24 | 19-08-24 | 4 | 3 | 4 | Weekend | |
| Bangladesh | 16-08-24 | -32515 | -45520 | x | |||
| Russia | 23-08-24 | 27-08-24 | 4 | 3 | 4 | Weekend |
I am trying to exclude weekends between 2 dates.
The field "Days to Approve" is a normal DATEDIFF like :
Well thinking a bit more about this I think that it is in the way both dax formulas work:
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.
5 Replies
- IdrissshatilaSuper 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)and the datediff as well
- rpinxtSolution 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?
- IdrissshatilaSuper User
Hello,
- rpinxtSolution Sage
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
- rpinxtSolution Sage
Well thinking a bit more about this I think that it is in the way both dax formulas work:
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.