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
I want to calculate the working days between dates with varying holidays within a specified period. For example, I have a table that lists personal holidays:
Person | Holidays |
Jane | 02-Feb-23 |
Jane | 03-Mar-23 |
Jane | 21-Jul-23 |
Michael | 01-Mar-23 |
And I have a table with jobs
Jobs | ||||
Job | Person | Start | End | Availability |
Job 1 | Jane | 01-Jan | 04-Feb | (Working days - holidays) |
Job 2 | Michael | 10-Feb | 21-Apr |
I need the Availability column to include working days between those dates (or dates i select from a slicer, for example all of February), removing dates from the other table where the person has a holiday. Can anyone help me find a solution for this please?
Solved! Go to Solution.
@Albatross810 So like this?
Measure =
VAR __Person = MAX('Jobs'[Person])
VAR __Result = NETWORKDAYS(MAX([Start]), MAX([End]), 1, SELECTCOLUMNS(FILTER('Holidays', [Person] = __Person),"__Holidays",[Holidays]))
RETURN
__Result
@Albatross810 New way: NETWORKDAYS function (DAX) - DAX | Microsoft Learn
Old way: Net Work Days - Microsoft Power BI Community
Been working with NETWORKDAYS all day, can't seem to solve this one. It doesn't sum multiple periods if I'm selecting several for example and won't let me use the holiday table dynamically by owner. But thank you for sharing.
@Albatross810 So like this?
Measure =
VAR __Person = MAX('Jobs'[Person])
VAR __Result = NETWORKDAYS(MAX([Start]), MAX([End]), 1, SELECTCOLUMNS(FILTER('Holidays', [Person] = __Person),"__Holidays",[Holidays]))
RETURN
__Result
Thanks so much, this worked well!
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 |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |