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
Anonymous
Not applicable

DateTime Difference excluding weekends/holidays

Hi,

 

How do I calculate the difference between two datetime columns and exclude weekends/holidays from the calculation?

I have created a standard calendar table and a public holidays table but not sure how to marry them together. 

 

Appreciate any help. 

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

Probably best is to merge both tables. Just add a new column to the main calendar table specifying whether a day is a holiday and another columns  whether it's weekday or weekend. Then you can just calculate the date difference by count the number of days in between your two dates excluding holidays and weekends.

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

Anonymous
Not applicable

@AlB that makes sense and makes it easier to manage. Will try that. Thank you.

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