Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AntoineOA
Frequent Visitor

Calculate the turnover of my company

Hello guys,

I am trying to calculate my company's turnover. I already tried to fix my problem by looking for the solution on other posts but I can't find it.

 

I have a date table added directly on powerbi that has no direct relation in my database.

I have an employee table with a start date and an end date within the company. Some of my employees have several rows because some of them have done an internship before being employed permanently. So I added a column where I add "leaver" if the person has left the company permanently.

 

I have so far done this measure:
Leavers = CALCULATE(
COUNTROWS(EMPLOYEE),
FILTER( VALUES( EMPLOYEE[ValidTo]), EMPLOYEE[ValidTo] <=MAX('Date'[Date])), EMPLOYEE[Internal_move] = "Leaver")

 

The result of this measure when I combine it with my date table gives me a cumulative increasing number of employees per year but not the exact number of people who left during the year. So the final result for 2022 is 72 but only 6 employees left the company in 2022.


How can I fix that to get 6 for 2022 ?
Thanks in advance

 

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @AntoineOA ,

 

What is the purpose of using "EMPLOYEE[ValidTo] <=MAX('Date'[Date])" in a formula?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Signore_Ands
Advocate II
Advocate II

Hi @AntoineOA 

Here is my measure for leavers in the Month:

Leavers This Month =
VAR CurrentMonth = SELECTEDVALUE('Calendar_Months'[month_of_yr])
VAR CurrentYear = SELECTEDVALUE('Calendar_Months'[calendar_yr])

RETURN
CALCULATE(MAX(SUM('PC - EE List'[#]),0),
FILTER('PC - EE List',
year('PC - EE List'[Termination Date])=CurrentYear &&
month('PC - EE List'[Termination Date])=CurrentMonth)
)

The Max is in there just to make sure we have a 0 rather than a Blank, if no one left in the reporting period.
The SELECTEDVALUE bits refer to the outputs of my slicers - year and month - on the report.

This should probably would work for the End Date in your data set, where the Leaver column in populated.

 

Hope that helps.

Hi @Signore_Ands 

I'm trying something like you. I splited values from my endDate column to create two news columns. One for LeavingYear and one for LeavingMonth. 
I don't really understand this part of your measure : CALCULATE(MAX(SUM('PC - EE List'[#]),0),
What is the #? 

In my Employee list I add a counter column (#) that has a 1 in every row. 
It's a way of doing the COUNTROWS(EMPLOYEE), that you are doing.
So by summing  the # column and filtering on the leave year and month, I get the count of leavers for that period.

Here's a snapshot of my data in case it helps:

Signore_Ands_0-1654089206603.png

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.