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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Lucifer2019
Helper I
Helper I

Trying to calculate a date based on working days from a date that is eneterd

Hi All,

I am trying to find a way to calculate a date that is 22 working days past a date that is entered into a table.

Need to make sure that weekends and federal holidays are not part of that 22 day count.

I tried using NETWORKDAYS, but that option is not available in the environment I am working in.

 

Example;

Date entered 12/31/22  + 22 working days = 2/2/23.

I need to calculate with a formula that will produce results for every day entered

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Lucifer2019 

I make an example on Calendar table:

1.Create a Calendar table, it includes weekday column:

Calendar = ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2023,12,31)),
"Weenday",WEEKDAY([Date],2))

2.Create a holiday table to input the holiday and related date

3.Then create the inputdate measure and the outputdate measure:

Outputdate = MAXX(TOPN(23,FILTER(ALL('Calendar'),[Date]>[Input_date]&&[Weenday]<6&&[Date]<>MAX(Holiday[Date])),[Date],ASC),[Date])

vxinruzhumsft_0-1673502669933.png

Best Regards!

Yolo Zhu

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

5 REPLIES 5
v-xinruzhu-msft
Community Support
Community Support

Hi @Lucifer2019 

I make an example on Calendar table:

1.Create a Calendar table, it includes weekday column:

Calendar = ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2023,12,31)),
"Weenday",WEEKDAY([Date],2))

2.Create a holiday table to input the holiday and related date

3.Then create the inputdate measure and the outputdate measure:

Outputdate = MAXX(TOPN(23,FILTER(ALL('Calendar'),[Date]>[Input_date]&&[Weenday]<6&&[Date]<>MAX(Holiday[Date])),[Date],ASC),[Date])

vxinruzhumsft_0-1673502669933.png

Best Regards!

Yolo Zhu

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

 

And how do I get it to work for the next 10 years?  Do I have to build a table that has all holidays for the next 10?

Hi @Lucifer2019 

Based on the solution in offered, you need to create a table to store the holiday.

Best Regards!

Yolo Zhu

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

 

I need to calculate a date that is 45 work days past the start date.  I have to account for all weekends and holidays, then give users a deadline for them to be finished with the task which is 45 work days after it was entered in the system

Greg_Deckler
Super User
Super User

@Lucifer2019 You could try the old school method: Net Work Days - Microsoft Power BI Community


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.