Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
Solved! Go to Solution.
Hi, @beerman99x
Based on your information, I create a sample table:
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:
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
Hi, @beerman99x
Based on your information, I create a sample table:
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:
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
Hello @beerman99x ,
check this https://learn.microsoft.com/en-us/dax/networkdays-function-dax
Proud to be a Super User! | |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!