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
rouxknee
Frequent Visitor

Display employee retention rate by decimal years

Hello!  I have a dataset that includes employee tenure in decimal years.  I'd like create a line graph that shows the retention rate where the X axis is years and the Y axiz is percent retention.  Essentially, it looks at:

 

count of employees with a tenure value >= value at X axis / total count of records. 

 

Values for this graph might be:

95% retention at 1 year

93% retention at 1.5 years

20% retention at 12.5 years, etc.

 

I imagine it will look something like this (with one line):

 

Image result for retention graph

 

Since I couldn't figure out how to attach data, here's a small dummy version of the dataset:

 

EmployeeTenure
21800.9
25891.81
24891.9
22331.97
23232.15
20612.57
24634.92
29647.95
24819.07
268211.68
289412.92
294713.01
291914.4
291214.45
279231.79
280537.1
278237.51
1 ACCEPTED SOLUTION

First add a column to create year for each employee based on tenure:

 

Year = var x =  FLOOR(Table1[Tenure],1) return if(x>12,12,x)

add measure for total employee count

 

Total Emp = CALCULATE(COUNT(Table1[Employee]), ALL(Table1))

add measure for running total 

 

Running Total = CALCULATE(COUNT(Table1[Employee]), Filter(ALL(Table1), Table1[Year]>=MAX(Table1[Year]))) 

add measure for retention %

 

Retention = DIVIDE([Running Total], [Total Emp], 0)

drop line visual wit year on x axis and retention on values.

 

Change retention measure format to %

 

Although these measures can be done in one measure, but I like to keep it seperate for simplicty and also  can be reused in other areas as well.

 

This is all for reference, you can change calc as you see fit.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

11 REPLIES 11

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.