Forum Discussion

dzaba's avatar
dzaba
Frequent Visitor
5 years ago
Solved

Employee turnover monthy

Hi, I am looking for a help with DAX to calculate the Employee turnover.    My data look like that:   Table name: Staff Population   To make this calculation I need 3 measuers: 1. The n...
  • v-deddai1-msft's avatar
    5 years ago

    Hi dzaba ,

     

    You can use the following three measures:

    Start month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MIN('Date'[Date])&&OR('Staff Population'[End Date]>=MIN('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 
    
    end month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MAX('Date'[Date])&&OR('Staff Population'[End Date]>=MAX('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 
    
    
    left employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[End Date] >=MIN('Date'[Date])&&'Staff Population'[End Date]<=MAX('Date'[Date])))

     

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai