Forum Discussion
Create measure between two timestamps, only count working hours
Careful what you are getting yourself into.
First of all, what is your timezone? Keep in mind the Power BI Service works on UTC.
Here are the steps you need to take:
- identify if the start timestamp is on a workday. If yes, find the difference in minutes between the start timestamp and the end of business hours (only consider it if not negative!). If no the number is zero.
- identify if the end timestamp is on a workday. If yes, find the difference in minutes between start of business hours and the end timestamp (again only if not negative!). If no then zero
- calculate the number of workdays AFTER your start timestamp day and BEFORE your end timestamp day. Exclude non-workdays (weekends, holidays). Multiply by 480 and add to the two other numbers.