Forum Discussion

Gekko1's avatar
Gekko1
Icon for Helper I rankHelper I
4 years ago
Solved

Get unique intervals from a column

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...
  • daXtreme's avatar
    4 years ago

    Gekko1 

     

    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.