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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
beerman99x
New Member

Add Working Days after Time

Hi,

I am trying to add the next available business day to my order creation column after a cut off time in another column or if the date in the original column is a weekend or holiday in my date table. 

My date table is arranged so that a business day is WD, weekend is WE and holiday is PH. 

 

 

 

PBI Order Issue.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @beerman99x 

Based on your information, I create a sample table:

vyohuamsft_0-1724221421970.png

vyohuamsft_1-1724221544238.png

Then create a calculated column, and try the following DAX expression:

NextBusinessDay = 
VAR OrderDate = [Order Creation Date]
VAR CutoffTime = TIME(17, 0, 0)
VAR OrderTime = [Creation Hour]
VAR IsAfterCutoff = OrderTime >= CutoffTime
VAR NextDay1 = 
    CALCULATE(
        MIN('Date'[Date]),
        FILTER(
            'Date',
            'Date'[Date] > OrderDate &&
            'Date'[DayType] = "WD"
        )
    )
VAR NextBusinessDay = 
    IF(
        IsAfterCutoff,
        NextDay1,
        OrderDate
    )
RETURN
    IF(
        MAX('Date'[DayType]) = "WD" && NOT IsAfterCutoff,
        OrderDate,
        NextBusinessDay
    )

Here is my preview:

vyohuamsft_2-1724221630334.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @beerman99x 

Based on your information, I create a sample table:

vyohuamsft_0-1724221421970.png

vyohuamsft_1-1724221544238.png

Then create a calculated column, and try the following DAX expression:

NextBusinessDay = 
VAR OrderDate = [Order Creation Date]
VAR CutoffTime = TIME(17, 0, 0)
VAR OrderTime = [Creation Hour]
VAR IsAfterCutoff = OrderTime >= CutoffTime
VAR NextDay1 = 
    CALCULATE(
        MIN('Date'[Date]),
        FILTER(
            'Date',
            'Date'[Date] > OrderDate &&
            'Date'[DayType] = "WD"
        )
    )
VAR NextBusinessDay = 
    IF(
        IsAfterCutoff,
        NextDay1,
        OrderDate
    )
RETURN
    IF(
        MAX('Date'[DayType]) = "WD" && NOT IsAfterCutoff,
        OrderDate,
        NextBusinessDay
    )

Here is my preview:

vyohuamsft_2-1724221630334.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Idrissshatila
Super User
Super User

Hello @beerman99x ,

 

check this https://learn.microsoft.com/en-us/dax/networkdays-function-dax

 

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors