Forum Discussion
Turnover over years
Hi there!
I have information of 5 key talent pools over 4 years and I will like to calculate the turnover between years, for example if the year selected is 2025 I would like to see how many employees that where HP 2024 still are HP in 2025, when 2024 is sleected I would like to see the turnover respect 2023, etc.
Hi mirmo ,
Thanks for reaching out to the Microsoft fabric community forum.1. Created sample data based on your inputs.
2. Created DAX measure "HP Turnover %" with below code.
HP Turnover % =
VAR SelectedYear = MAX(TalentData[Year])
VAR PrevYear = SelectedYear - 1VAR PrevHP =
FILTER(
TalentData,
TalentData[Year] = PrevYear &&
TalentData[KTP] = "HP"
)VAR PrevHP_IDs = SELECTCOLUMNS(PrevHP, "ID", TalentData[ID])
existed in HP last year
VAR StillHP =
FILTER(
TalentData,
TalentData[Year] = SelectedYear &&
TalentData[KTP] = "HP" &&
TalentData[ID] IN PrevHP_IDs
)VAR Retained = COUNTROWS(StillHP)
VAR TotalPrev = COUNTROWS(PrevHP)RETURN
IF(
TotalPrev = 0,
BLANK(),
FORMAT(1 - DIVIDE(Retained, TotalPrev), "0.0%")
)3. Created a Year slicer based on TalentData[Year]. Add a Card visual for the HP Turnover % measure.
4. Please refer the attached PBIX file for your reference.
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
11 Replies
- lbendlin
Super User
Sounds good. Would you want to use a Sankey chart visual for that?
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - mirmoNew Member
thanks for the Reply! here is an example of the data I have, what I need is to calculate the Turnover %
ID Year IdYear KTP 1 2025 12025 HP 2 2025 22025 HP Turnover 3 2025 32025 HP KTP 2025 3 66% 1 2024 12024 HP KTP 2024 1 100% 2 2024 22024 NO KTP 2023 2 N/A 3 2024 32024 NO 1 2023 12023 NO 2 2023 22023 HP 3 2023 32023 HP - DataNinja777
Super User
Hi mirmo ,
To calculate year-over-year turnover for key talent pools in Power BI, you need a table that includes at least EmployeeID, Year, and TalentPool. The goal is to determine how many employees remained in the same pool from one year to the next, such as how many employees in the HP category in 2024 are still in HP in 2025. This is a retention calculation. To get started, you can create a DAX measure called HP Retention that dynamically checks the selected year and compares it to the previous year.
HP Retention = VAR SelectedYear = MAX('Calendar'[Year]) VAR PreviousYear = SelectedYear - 1 VAR HP_LastYear = FILTER( 'TalentData', 'TalentData'[Year] = PreviousYear && 'TalentData'[TalentPool] = "HP" ) VAR HP_ThisYear = FILTER( 'TalentData', 'TalentData'[Year] = SelectedYear && 'TalentData'[TalentPool] = "HP" ) RETURN CALCULATE( COUNTROWS(HP_LastYear), INTERSECT( SELECTCOLUMNS(HP_LastYear, "EmployeeID", 'TalentData'[EmployeeID]), SELECTCOLUMNS(HP_ThisYear, "EmployeeID", 'TalentData'[EmployeeID]) ) )To calculate the turnover, you can create another measure called HP Turnover by subtracting the retained count from the total HP population in the previous year.
HP Turnover = VAR SelectedYear = MAX('Calendar'[Year]) VAR PreviousYear = SelectedYear - 1 VAR Total_HP_LastYear = CALCULATE( COUNTROWS('TalentData'), 'TalentData'[Year] = PreviousYear, 'TalentData'[TalentPool] = "HP" ) RETURN Total_HP_LastYear - [HP Retention]This setup will allow your report to dynamically show the number of employees retained or lost from the HP pool, depending on the year selected in the slicer. You can replicate this logic for other talent pool categories by changing "HP" to the desired pool or making it a variable based on user selection.
Best regards,
- mirmoNew Member
I get an error:
- v-menakakota
Community Support
Hi mirmo ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster. Can you please provide sample data.
Thank you.
- v-menakakota
Community Support
Hi mirmo ,
May I ask if you have resolved this issue? Can you please update on this issue.
Thank you.
- v-menakakota
Community Support
Hi mirmo ,
Thanks for reaching out to the Microsoft fabric community forum.1. Created sample data based on your inputs.
2. Created DAX measure "HP Turnover %" with below code.
HP Turnover % =
VAR SelectedYear = MAX(TalentData[Year])
VAR PrevYear = SelectedYear - 1VAR PrevHP =
FILTER(
TalentData,
TalentData[Year] = PrevYear &&
TalentData[KTP] = "HP"
)VAR PrevHP_IDs = SELECTCOLUMNS(PrevHP, "ID", TalentData[ID])
existed in HP last year
VAR StillHP =
FILTER(
TalentData,
TalentData[Year] = SelectedYear &&
TalentData[KTP] = "HP" &&
TalentData[ID] IN PrevHP_IDs
)VAR Retained = COUNTROWS(StillHP)
VAR TotalPrev = COUNTROWS(PrevHP)RETURN
IF(
TotalPrev = 0,
BLANK(),
FORMAT(1 - DIVIDE(Retained, TotalPrev), "0.0%")
)3. Created a Year slicer based on TalentData[Year]. Add a Card visual for the HP Turnover % measure.
4. Please refer the attached PBIX file for your reference.
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
- v-menakakota
Community Support
Hi mirmo ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.