Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
So, my question is: I need to get the employees' worked hours from my company's call center. The thing is, a same employee can be in multiple calls simultaneously, however the calculated hours should be unique, for example: if the employee was in 2 calls; the first one began at 9:00 am and ended at 9:30 and the second one began at 9:00 am and ended at 9:20 am, the worked hours should be 30 minutes. The current dataset that I have is built in such way that if I just sum the durations of the calls I wouldnt get the actual worked hours due to some intervals being contained in larger intervals. How could I get through that?
Employees | Call start | Call end |
Employee 1 | 08/08/2022 9:00 | 08/08/2022 9:40 |
Employee 1 | 08/08/2022 9:10 | 08/08/2022 9:30 |
Employee 2 | 08/08/2022 10:00 | 08/08/2022 10:35 |
Employee 2 | 08/08/2022 10:10 | 08/08/2022 10:20 |
In the example above, the employee 1 actually worked 40 minutes (duration of the biggest interval) and employee 2 worked 35 minutes.
Solved! Go to Solution.
Create a table where all the intervals are expanded into minutes throughout the day. Here's what such a table should look like:
EmployeeId | CallId | Date | MinuteId
----------------------------------------
Once you've got this, it's easy to calculate unique time. You can add as many attributes to the table as you need to track all necessary details. Your DAX for calculating the number of unique minutes will then be:
[# Minutes] = distinctcount( T[MinuteId] )
How easy is that, huh? Bear in mind, please, that MinuteId should be unique across all days. If you make it unique only throughout a day, you'll have a much harder time to calculate. I would suggest that you just number all the minutes consecutively starting from the beginning of your time.
Create a table where all the intervals are expanded into minutes throughout the day. Here's what such a table should look like:
EmployeeId | CallId | Date | MinuteId
----------------------------------------
Once you've got this, it's easy to calculate unique time. You can add as many attributes to the table as you need to track all necessary details. Your DAX for calculating the number of unique minutes will then be:
[# Minutes] = distinctcount( T[MinuteId] )
How easy is that, huh? Bear in mind, please, that MinuteId should be unique across all days. If you make it unique only throughout a day, you'll have a much harder time to calculate. I would suggest that you just number all the minutes consecutively starting from the beginning of your time.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |