Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

calculate employee position Duration

Hi, i am posting this again. i have a table and i want to calculate time period for a person's current position mean how much time he spent on the specific role. for example Amanda in 2015 was on ED...
  • amitchandak's avatar
    amitchandak
    4 years ago

    Anonymous , That will not add up 

     

    New column =
    var _min = minx(filter(Table, [Employee Name] = earlier([Employee Name]) && [Effective from] > earlier([Effective from])), [Effective from])

    var _diff = datediff([Effective from], coalesce(_min, today()), month)
    return Quotient(_diff ,12) & " Years " & Mod(_diff ,12)  & " Months"