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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aar21292
Frequent Visitor

Retention calculation based on lookup

Hi all

I'm new to Power BI, and was wondering how to get an employee retention % calculation.

What I need is get a list of ids at start of period (min of date period used in X-axis) example year, month, week etc
Then get the another list of ids at the end of period selected above (example if using end of year, month, week etc) and lookup unique ids with the list of start of period and get a count of how many remained.
Then divide the count at the end of period with the total at the start of period.


So as an example if I use month in my X-axis, I want to count the number of employees at start in January (example 100), then get a count of how many employees stayed (from the starting 100) at the end of January (example 75) and divide the 75 by 100. 

What measures and calculations would I need to achieve this?

Thanks
Aaron

3 REPLIES 3
lbendlin
Super User
Super User

It woud be easier to record the leaving events, rather than having to confirm active status for all employees at the end of each period.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

@lbendlin 
So a sample of the data would be something like this:

Created DateUnique IdStatus
01/01/202312345Active
01/01/202312346Active
01/01/202312347Active
03/01/202312348Active

 

Created DateUnique IdStatus
31/01/202312345Active
31/01/202312346Active
31/01/202312348Active
22/02/202312349Active

 

So let's say in my charts I have slicers to calculate retention for the period 01/01/2023 - 31/01/2023. So what I would like to do is count unique records that were created at start of period. Then count unique records at the end of the period that were also found at start of period. Then divide the end count by the start count.

Referring to the above data set, on 1st January we had 3 created records. One of those records left, and on 31st January we only remained with 2 records that were in the 1st January list. So my expected result should be 2/3=67% retention.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.