Divide With a Sum and Filter on average column

Addora

New Member
Joined
Jan 4, 2014
Messages
11
I ask to compute attrition rate from two different data sources. I have 2 different sources:

large


1st: employee headcount (one row per employee) which has all employee details such as Name, ID, Date of Joining, Supervisor name, Department etc.

2nd: showing data for employees who resigned

I need to compute the attrition rate for selected Group and selected months. Groups and months will be selected from slicers.

the attrition function is: Sum of Leavers / Average monthly Headcount

this function must consider the slicer filter ex: if I select one group with one month the function will be


Sum of Leavers for this group and this month / Average monthly Headcount for this group and this month


and used measure, unfortunately, give non-valid results

Attrition.pbix file

gratefully,
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I'm on an iPad so I can't easily see the sample (but thanks for providing it). In general, this is what you would do

create a calendar table and join it to the attrition table on the depart date.
Write a measure that is simply countrows(attrition). This will give you those leaving for any slicer date or dept.

Current staff level is harder. You need to write a manual filter (no relationship)

something like this

calculate (countrows(staff),filter(staff,staff[start date] >= min(calendar(date)) &&
staff[end date] <= max(calendar(date))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top