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
kasiaw29
Resolver II
Resolver II

Add number of working days to a date - power query included

Hi all,

 

I have a tiny problem that I am most likely overthinking. 

I have a requirement to add a number to a date in working days. So far I got it. I had to merge some queries and I have used Date.AddDays query to get my 'Result'.

Below table is a sample result from my data. It looks great and does exactly what is asked of it.

I now need to be able to omit Saturdays and Sundays if my result happens to be a saturday or sunday: 

 

Original DateDays to add  Result Working day? Ideal Result
29/06/2020504/07/2020No, it's a Saturday

06/07/2020

(Monday)

 

I have created a date dimension table that simply works out week numbers and then determines if a date is a working one or not ( 1,0)

 2020-07-20_12-12-39.jpg

 

Has anyone completed anything like this before? I nudge in the right direction would be much appreciated! 

Thanks! 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@kasiaw29 

This will be your new column to show the expected Result date:

=let D = Date.AddDays([Original Date],[Days To Add]) in 

if Date.DayOfWeek(D,Day.Saturday)=0 then Date.AddDays(D,2)

else if

Date.DayOfWeek(D,Day.Saturday)=1 then Date.AddDays(D,1)

else

D

Fowmy_0-1595247127985.png

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS ☺

YouTube | LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@kasiaw29 

This will be your new column to show the expected Result date:

=let D = Date.AddDays([Original Date],[Days To Add]) in 

if Date.DayOfWeek(D,Day.Saturday)=0 then Date.AddDays(D,2)

else if

Date.DayOfWeek(D,Day.Saturday)=1 then Date.AddDays(D,1)

else

D

Fowmy_0-1595247127985.png

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS ☺

YouTube | LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hey @Fowmy ! 

 

I ended up doing pretty much what you have suggested and it works a treat! 

 

Thanks a lot for input!

@kasiaw29 

Glad it worked for you!

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube | LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@kasiaw29 , not completely clear.  In case you want to add or subtract working days

refer : https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak will look through this solution and update shrotly. 

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.