Forum Discussion

vinidegrandi's avatar
vinidegrandi
Regular Visitor
3 years ago
Solved

Calculate with items in the same column

I am trying to calculate the hours worked per month for every employee. This is based on a Sharepoint list. Their usernames go into the title column, then the ActivityType column details what they di...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi vinidegrandi ,

     

    Try below formula:

    time_diff = 
    var Check_In = calculate(max([activitydatetime]), filter(yourtable,[activitytype]=earlier([activitytype])-1))
    
    Return
    datediff(Check_In,[activitydatetime],HOUR)

     

  • ChainsawMan's avatar
    ChainsawMan
    3 years ago

    vinidegrandi 
    Your ActiveType is a "Text" type. Please change its type to "Number" then you could use the DAX above.

     

    Best Regards.