Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 :
Solved! Go to Solution.
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.
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.
@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,
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
Hello @rpinxt ,
weird behaviour you're having here, I tried the networkdays and it shows 3 days
and the datediff as well
Proud to be a Super User! | |
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
46 |