The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys,
Eventhough I have read several posts on this topic, non seem to answer the question(s) that I have, so here I go:
I am trying to calculate the monthly turonver rate of my employees.
The tables and columns present are:
1. A datetable
2. An employee table with:
- Employee ID
- Starting Date
- Termination Date
Preferably I would like the turnover rate to be calculated as:
Number of terminations in given month / Average amount of employees in given month.
However, if this is too much of a challenge it could also be:
Number of terminations in given month / Amount of employees at beginning of the month.
I am really struggling with the relations and the calculations to make this work.
Can someone please tell me step by step how to make this work.
Would be huge 🙂
Solved! Go to Solution.
Hi @MDeemter
Please try this:
Here I create a set of sample:
Then add a measure:
MEASURE =
VAR _currentdate =
MAX ( 'Table'[Date] )
VAR _terminationsnumofmonth =
COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
MONTH ( 'employe'[Termination Date] ) = MONTH ( _currentdate )
)
)
VAR _beginningofmonthnum =
COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
'employe'[Starting Date]
< DATE ( YEAR ( _currentdate ), MONTH ( _currentdate ), 1 )
)
)
- COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
'employe'[Termination Date]
< DATE ( YEAR ( _currentdate ), MONTH ( _currentdate ), 1 )
)
)
RETURN
_terminationsnumofmonth / _beginningofmonthnum
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MDeemter
Please try this:
Here I create a set of sample:
Then add a measure:
MEASURE =
VAR _currentdate =
MAX ( 'Table'[Date] )
VAR _terminationsnumofmonth =
COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
MONTH ( 'employe'[Termination Date] ) = MONTH ( _currentdate )
)
)
VAR _beginningofmonthnum =
COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
'employe'[Starting Date]
< DATE ( YEAR ( _currentdate ), MONTH ( _currentdate ), 1 )
)
)
- COUNTROWS (
FILTER (
ALLSELECTED ( employe ),
'employe'[Termination Date]
< DATE ( YEAR ( _currentdate ), MONTH ( _currentdate ), 1 )
)
)
RETURN
_terminationsnumofmonth / _beginningofmonthnum
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Strangely this works on your data. But if I copy the measure and fill in my table and columnnames, the percentages are all negatives and far from what they should be...
Also I might add that the report has to be dynamic, so it should be possible to select a specific month with a slicer.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |