Forum Discussion
Calculate hours between two date/time columns and exclude weekends
- 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
Thanks for the reply.
Each row is basicly a ticket with a start and end-date/time (Opened and solved) and I want to calculate the number of hours it takes so solve every ticket. And by weekend I mean I want to exclude the hours from saturday and sunday since we are not measured in the SLA on the weekends. Make this more sense now?
Im familiar with the DATEDIFF formula but if a ticket is opened on a friday and solved on a monday, it will include the hours from the weekend and I don't want it to include the hours from the weekend.
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
- NDRS2 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