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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jimpatel
Post Patron
Post Patron

Adding working days to date

Hi,

 

Thanks for looking at my post.

 

I am using below formula but for somereason it is not working correctly. What i am looking for is i wanted to add 2 working days extra to "Date" column. If Date fall on 11th july (thursday) then new date will be 15th July (Monday) due to weekend inbetween. Any idea please?

 

Thanks a lot

 Table1

Due Date = SWITCH(TRUE(),
         WEEKDAY( 'Table1'[Date] + 1,1) = 7 , 'Table1'[Date] + 4, 'Table1'[Date] + 2
)

 

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@jimpatel , Try using below measure

 

Due Date =
VAR CurrentDate = 'Table1'[Date]
VAR DayOfWeek = WEEKDAY(CurrentDate, 2) -- 2 means Monday=1, Tuesday=2, ..., Sunday=7
RETURN
SWITCH(
TRUE(),
DayOfWeek <= 3, CurrentDate + 2, -- Monday to Wednesday
DayOfWeek = 4, CurrentDate + 4, -- Thursday
DayOfWeek = 5, CurrentDate + 4, -- Friday
DayOfWeek = 6, CurrentDate + 4, -- Saturday
DayOfWeek = 7, CurrentDate + 3 -- Sunday
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Anonymous
Not applicable

Hi @jimpatel ,

I create a table as you mentioned. Then I create a calculated column and here is the DAX code.

NewDate = 
VAR StartDate = 'Table'[Date]
VAR DaysToAdd = 2
VAR WeekdayNumber =
    WEEKDAY ( StartDate, 2 )
VAR DaysAdded =
    SWITCH (
        TRUE (),
        WeekdayNumber + DaysToAdd <= 5, DaysToAdd,
        WeekdayNumber + DaysToAdd > 5, DaysToAdd + 2
    )
RETURN
    StartDate + DaysAdded

Finally I will get what you want.

vyilongmsft_0-1722414533264.png

 

 

 

Best Regards

Yilong Zhou

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 @jimpatel ,

I create a table as you mentioned. Then I create a calculated column and here is the DAX code.

NewDate = 
VAR StartDate = 'Table'[Date]
VAR DaysToAdd = 2
VAR WeekdayNumber =
    WEEKDAY ( StartDate, 2 )
VAR DaysAdded =
    SWITCH (
        TRUE (),
        WeekdayNumber + DaysToAdd <= 5, DaysToAdd,
        WeekdayNumber + DaysToAdd > 5, DaysToAdd + 2
    )
RETURN
    StartDate + DaysAdded

Finally I will get what you want.

vyilongmsft_0-1722414533264.png

 

 

 

Best Regards

Yilong Zhou

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

bhanu_gautam
Super User
Super User

@jimpatel , Try using below measure

 

Due Date =
VAR CurrentDate = 'Table1'[Date]
VAR DayOfWeek = WEEKDAY(CurrentDate, 2) -- 2 means Monday=1, Tuesday=2, ..., Sunday=7
RETURN
SWITCH(
TRUE(),
DayOfWeek <= 3, CurrentDate + 2, -- Monday to Wednesday
DayOfWeek = 4, CurrentDate + 4, -- Thursday
DayOfWeek = 5, CurrentDate + 4, -- Friday
DayOfWeek = 6, CurrentDate + 4, -- Saturday
DayOfWeek = 7, CurrentDate + 3 -- Sunday
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.