Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

monthly attrition % dynamically

Hi All,

 

I have a table that has Employee name, Date of Joining and Date of Last Working day.  I want to calculate the attrition % as mentioned below:

Link for sample data: https://drive.google.com/file/d/1QrL3JvPDh_WgvvVWxiSTtokNKQBetLNb/view?usp=sharing

 

Name Date of JoiningLast working day 
Alexis Valenzuela16-Mar-20 
Erasmo Gonzalez02-Mar-20 
Michelle Carrasco02-Mar-20 
Lisa Zubia02-Mar-20 
Christopher A Fernandez16-Mar-20 
Donna Hammond26-May-20 
Karen-Gabriela Medina-Gamboa16-Mar-20 

 

MonthsAttritionAttrition%
Jan'206014%
Feb'20112%
Mar'2000%
Apr'2041%
May'2010%
Jun'20275%
Jul'20163%
Aug'2081%
Sep'20212%
Oct'20665%
Nov'20191%
Dec'2000%

 

Here are the excel formula's used to arrive the desired output

AttritionCOUNTIFS(Sheet1!$C:$C,">="&A3,Sheet1!$C:$C,"<="&EOMONTH(A3,0))
Attrition%B3/(COUNTA(Sheet1!$A:$A)-1-COUNTIF(Sheet1!$B:$B,">="&A3))

 

i have created measure "leaverscount = COUNT('MDB Data'[Last working day ])" to get Attrition count, but stuck with Attrition% as it is dynamic.

 

I tried few things like creating year and month columns, merge as new one and then get the count less than or equal to that month, but couldn't get it.

 

Any help on this is much appreciated.

 

Regards,

Pavan

  • Anonymous solution attached, you can tweak as per your need.

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

     

2 Replies

  • Anonymous solution attached, you can tweak as per your need.

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi parry2k ,

       

      Thank you for your time and solution. it worked perfectly.

       

      Regards,

      Pavan