Forum Discussion
NDRS
2 years agoFrequent Visitor
Calculate hours between two date/time columns and exclude weekends
Hi all, first post here so be nice since im a beginner. 🙏 Im trying to caculate the hours between two columns including start date/time and end date/time and I want to exlude the weekends. I have...
- 2 years ago
you can identify the number of weekends between the 2 dates via the below thread :
And via datediff get the hours count between the 2 dates and substract the hours based on number of weekends * 24
NandanHegde
Super User
2 years agoyou can identify the number of weekends between the 2 dates via the below thread :
And via datediff get the hours count between the 2 dates and substract the hours based on number of weekends * 24
NDRS
2 years agoFrequent Visitor
Thanks! Great way to solve it.
I used this formula:
Custom = DATEDIFF('MyTable'[Start date],'MyTable'[End date],HOUR) -
COUNTROWS(FILTER(CALENDAR('MyTable'[Start date],'MyTable'[End date]), WEEKDAY([Date],2) in {6,7} )) * 24