March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I've looked at a number of posts on similar issues, however I still can't get this to work.
I have a table with work received and closed dates in separate columns. I need to calculate the number of working days between the two dates, excluding and holidays.
I have a date table set up, which pulls through the holidays from another table and a column which gives a 1 or 0, depending on whether it is a working day or not, using the following logic
Using DATEDIFF, I can get the number of days between the two date field, however I'm getting stuck on how to filter out the holidays on the date table.
Could someone please let me know what I should be doing with the logic to achieve this?
Thank you.
Solved! Go to Solution.
@Hundoa , refer two the second page - workday diff of the attached file after signature
Or Refer :https://www.sqlbi.com/articles/counting-working-days-in-dax/
Check my example below, pbix also attached. You may add other bank holiday conditions to the filter if you have.
Column = CALCULATE(COUNTROWS('Date table'),
FILTER('Date table',[Date]>=EARLIER(([Start]))&&[Date]<=EARLIER([Close])),
FILTER('Date table',WEEKDAY('Date table'[Date],2)<>6 &&WEEKDAY('Date table'[Date],2)<>7))
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
@Hundoa , refer two the second page - workday diff of the attached file after signature
Or Refer :https://www.sqlbi.com/articles/counting-working-days-in-dax/
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |