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

HR Churn visual in HR Sample

I am new to Power BI and would like to create the HR Churn visual that is part of the mobile HR Sample.

 

My table has the employee ID, hire date, and termination date if terminated. What columns/measures do I create for the HR Churn visual?

 

HR Churn Graph.jpg

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@bbreitenbach

 

Try to use a calculated table following below steps.

  1. The dataset is as below
    Capture.PNG
  2. Create a calculated table
    newTable = UNION(ADDCOLUMNS(ALL(Emp[ID],Emp[hire date]),"Status","HIRE"),ADDCOLUMNS(FILTER(ALL(Emp[ID],Emp[termination date]),ISBLANK(Emp[termination date])=FALSE()),"Status","Terminate"))
    Capture.PNG
  3. Done
    Capture.PNG

I don't have idea on "HR Churn visual" which seems a 3rd party visual. You can tweak the steps in the visual accordingly.

View solution in original post

4 REPLIES 4
Eric_Zhang
Employee
Employee

@bbreitenbach

 

Try to use a calculated table following below steps.

  1. The dataset is as below
    Capture.PNG
  2. Create a calculated table
    newTable = UNION(ADDCOLUMNS(ALL(Emp[ID],Emp[hire date]),"Status","HIRE"),ADDCOLUMNS(FILTER(ALL(Emp[ID],Emp[termination date]),ISBLANK(Emp[termination date])=FALSE()),"Status","Terminate"))
    Capture.PNG
  3. Done
    Capture.PNG

I don't have idea on "HR Churn visual" which seems a 3rd party visual. You can tweak the steps in the visual accordingly.

Eric,

 

Thanks for the suggestion to use a calculated table.

 

I changed the table to:

HRChurnTable = UNION(ADDCOLUMNS(ALL(EmpComp[EecEEID],EmpComp[Last Hire Date]),"Joined", 1, "Left", 0), ADDCOLUMNS(FILTER(ALL(EmpComp[EecEEID],EmpComp[Termination Date]),ISBLANK(EmpComp[Termination Date])=FALSE()),"Joined", 0,"Left",-1))

 

and did the graph summing the "Joined" and "Left" columns. That gave me positive and negative numbers on the clustered column chart.

 

Thanks again!

@bbreitenbach

 

You're welcome. 🙂

 

If there's no further questions, to close this thread,  you can accpet the suggestion(s) that help as solution.

Sorry for bringing this thread back to life.  This solution worked perfectly for me.  I'm wondering how I can calculate the total number of employees over time to add it as a secondary axis line chart?  For example, if a new company started with 5 employees in 2016, then in 2017 they added another 10, but lost 3; the line would chart at 5 in 2016 and then 12 in 2017.

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.