Attrition exercise 3.xlsm


Please check my file. I am stuck on the calculation of the attrition for quarters and years.
First i used some dax measures for my data model wich i will explain down:

1. =DISTINCTCOUNT([Nume Angajat]) - this one will extract me the uniq employees collumn Nume Anagajat

2. =CALCULATE([Angajat Unic],FILTER(Table2,Table2[Openingbody]=VALUE(1))) this one will look into the opening body after the distinctcount.

I need your opinion for my openingbody collumn which dose this : (=IF([@[Angajati/body]]=1,[@[Angajati/body]]-[@[Employees Added]],0))

i added the if to except the cases where angajati body are 0 because the results will be -. and zero happens if the angajati body (which represent the employees body) were not active in that period.

The datamodel is organized for eachmonth since we start the company activity, employees can be present in periods even though they have 0 activity (that is an error of the database wich i have to live with) i saw on some examples that people use different models like uniq employees day started day ended but my case is not this and that is why i created the helper collumn angajatibody wich looks if the employee was active and gives value 0 or 1.

In the opening body collumn i search to remove the new employes for the period, if a guy is a new employ, it will have 1 in the employees added collumn. (but it can also be a new employee without activity in that month so sometimes in my openingbody formula the results could have gone with minus that is why i implemented the (=IF([@[Angajati/body]]=1) above,
(because i only look for people that worked 15 days at least in that month in collumn angajati body). (=IF(MONTH(I8653)=2,INT(DAYS(A8653,I8653)<=14),INT(DAYS(A8653,I8653)<=15))-IF(MONTH(H8653)=2,INT(DAYS(A8653,H8653)<=14),INT(DAYS(A8653,H8653)<=15))), (do you think it s a good helper collumn or should i use dax to implement the oppening bodys for each month cause i saw some measures on the internet wich seems for me a little bit tricky and i don t know exactly how to extract tham



3. =CALCULATE(DISTINCTCOUNT([Nume Angajat]),FILTER(Table2,Table2[Iesiri]=VALUE(1))) - exists
4. =CALCULATE(DISTINCTCOUNT([Nume Angajat]),FILTER(Table2,Table2[Employees Added]=VALUE(1))) - new hires
5. =[Openingbody unic]-[Exits]+[New Hires] - closing body


AND THE ATTRITION WHICH IS AS FALLOWING =DIVIDE([Exits],[ClosingBody])

I personaly think for month it does it as it is. (and i also need your opionion if it s ok)
But for quarters and years it s not the solution.
The solution will be like this for quarters

Atritie= total exits / (average of each month values for openingbody unic)

I have 2 options to calculate my atrition first is to take the total exits of selected period and divide by average of each month. for example if i want to look into atrition for qrt 1 2022 i would say 7 / avg ( 3,7,5)

Atritie = exits /((openingbody unic + closing body)/2)

OR i can calculate like 7 / ((3+7)/2) for qrt 1 2022

I need to extend this measures to years also.

Help!