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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Vaillo
Frequent Visitor

Set Due Date based on working days

Hi everyone, 

 

I need to calculate a Due Date column based on a given date and working days. 

 

I am working with tickets issue in a given date-time that have to be completed before a due date based on different OLAs. I am having issues trying to calculate the Due Date for those tickets with OLAs 1, 3, 5 and 7 working days.

 

As an example, if I am getting a tickets issued on Wednesday 25/07/2018 11:00 with an OLA of 3 working days, it has to be completed by Monday 30/07/2018 17:00 (Close of business hours).

 

I have seen several post about counting working days between two dates based on a date table, but I don't know how to apply the same logic to get the Due Date column based on a fix number of working days. 

 

Hope you can guide me to the right solution. 

 

Much appreciated.

 

Vaillo

6 REPLIES 6
Anonymous
Not applicable

Hi @Vaillo,

 

I'd like to suggest you use countrows with calendar functions to create variable calendar table to calculate working days.


Calculate column sample:

working days except weekend =
VAR endDate =
    IF ( Table[End] <> BLANK (), Table[End], TODAY () )
VAR _calendar =
    FILTER ( CALENDAR ( Table[Start], endDate ), WEEKDAY ( [Date], 2 ) <= 5 ) //calendar wihtout weekend
VAR _holidayList =
    VALUES ( Holiday[Date] ) //holiday date list
RETURN
    IF (
        COUNTROWS ( _holidayList ) > 0,
        COUNTROWS ( EXCEPT ( _calendar, _holidayList ) ),
        COUNTROWS ( _calendar )
    )


Regards,

Xiaoxin Sheng

Hi @Anonymous,

 

Thank you for your answer.

 

That's not exactly what I am looking for. You are calculating the number of working days based in an end date. I need to do the opposite, calculate the end date based on the number of working days.

 

My scenario is the following: I get jobs issued with different OLAs (1, 3, 5 or 7 working days), so I need to calculate the date when the jobs are due to organise the workforce to meet as many OLAs as possible. So I need to create a calculation that given the date the job was issued and the number of working days of its OLA, I could get the date the job is due:

 

           Due Date = fx ( Date issued, Number of working Days)

 

Best regards, 

 

Vaillo

 hi 

actually i was looking the same thing . i wanted to caculate the due date based in working days.

 

Anonymous
Not applicable

Hi @Vaillo,

 

So you mean you want to calculate max deadline based on current date and working days?


If this is a case, you can try to use below formula:

 

Max available deadline =
VAR _workingDays = xxxx
VAR _nonWorkingDays =
    COUNTROWS (
        FILTER (
            CALENDAR ( Table[Start], Table[Start] + _workingDays ),
            WEEKDAY ( [Date], 2 ) > 5
        )
    )
RETURN
    Table[Start] + _workingDays
        + _nonWorkingDays

 

 

Regards,

Xiaoxin Sheng

parry2k
Super User
Super User

are you working days mon-fri?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yes, and I have to take into account public holidays as well (by state), so I have a date table with the working days. The issue is that I don't know how to use the table to be able to count 1,3,5 or 7 business dates to get the Due Date I need.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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