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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Uspace87
Resolver III
Resolver III

Adding Working days to Order Created date

Hi everyone,

 

I would like to calculate a Shipping Date (Deadline) for WebOrders adding the Shipping condition and skipping not working days like Weekend and Public Holidays. 

 

 

 

Order Created DateShipping ConditionShipping Date
23/12/202248hrs  

 

In the Example above the order has been create on 23/12/2022 which is Friday so in this case I can consider 24hrs for the 23rd, then I will have to skip 24/12-25/12-26/12-/27/12 because them are public holidays so the actual Shipping date should be 28/12 EOD.

 

Any help please?

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Uspace87 

Not sure if i fully get your,  you may try to add a column like this:

EOD - NextWorkingDay = 
VAR _date = [OrderDate]
RETURN
 MINX(
    FILTER(
        data,
        data[OrderDate]> _date
            && NOT WEEKDAY(data[OrderDate], 2) IN {6, 7}
            && NOT [OrderDate] IN VALUES(Holiday[Holidays])
    ),
    data[OrderDate]
)

 

tried and it worked like this:

FreemanZ_0-1672846340519.png

the holiday table:

FreemanZ_1-1672846365632.png

 

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @Uspace87 

Not sure if i fully get your,  you may try to add a column like this:

EOD - NextWorkingDay = 
VAR _date = [OrderDate]
RETURN
 MINX(
    FILTER(
        data,
        data[OrderDate]> _date
            && NOT WEEKDAY(data[OrderDate], 2) IN {6, 7}
            && NOT [OrderDate] IN VALUES(Holiday[Holidays])
    ),
    data[OrderDate]
)

 

tried and it worked like this:

FreemanZ_0-1672846340519.png

the holiday table:

FreemanZ_1-1672846365632.png

 

That is brilliant thank you, I had to add some other logic but that formula is perfect! Thank you very much!

BITomS
Resolver III
Resolver III

Hi @Uspace87,

 

This is the DAX function you require: https://learn.microsoft.com/en-us/dax/networkdays-dax

 

Hope it helps.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors