Aller au contenu (Pressez Entrée)
  • Accueil
  • Blog
  • Portfolios
DAXPowerBi

Human Ressources Dashboard

This simple dashboard provides some HR metrics for a company. The data is in CSV format and was taken from kaggle.com. The measures were created with the DAX language.

DAX Code

###########################################
########## count actif employees ##########
###########################################
m00_ActiveEmployes = 
VAR totEmp = SUM('HR Data xlsx - HR data'[Employee Count])
VAR nonActEmp = 
    CALCULATE(
        COUNTROWS('HR Data xlsx - HR data'),
        'HR Data xlsx - HR data'[Attrition] = "Yes"
    )

RETURN
totEmp - nonActEmp

################################################
########## count actif employees in % ##########
################################################
m00_ActEmplDepartment = 
VAR WorkDepart = SELECTEDVALUE('HR Data xlsx - HR data'[Department])
VAR ActEmpl = SELECTEDVALUE('HR Data xlsx - HR data'[emp no])
VAR TotCat = SUMX(FILTER(ALL('HR Data xlsx - HR data'), 'HR Data xlsx - HR data'[Department] = WorkDepart), 'HR Data xlsx - HR data'[emp no])
VAR res = ActEmpl/TotCat

RETURN res

################################################
########## count attitrition employees #########
################################################
m00_AttitritionCount = --count the number of employees leaving and not being replaced
CALCULATE(
    COUNT('HR Data xlsx - HR data'[Employee Count]), 
    'HR Data xlsx - HR data'[Attrition] = "Yes"
)

################################################
############### attitrition rate ###############
################################################
m00_AttritionRate = 

VAR attitYes = 
    CALCULATE(
        COUNTROWS('HR Data xlsx - HR data'),
        'HR Data xlsx - HR data'[Attrition] = "Yes"
    )
        
VAR totEmpl = SUM('HR Data xlsx - HR data'[Employee Count])

RETURN
DIVIDE(attitYes, totEmpl, "No data")

################################################
############ average age of employees ##########
################################################
m00_AverageAge = AVERAGE('HR Data xlsx - HR data'[Age])

################################################
############ average income  ###################
################################################
m00_AverageIncomEmp = AVERAGE('HR Data xlsx - HR data'[Monthly Income])


################################################
############## count all employees #############
################################################
m00_CountEmployees = COUNT('HR Data xlsx - HR data'[Employee Count]) --count nomber of employees


--title color--
#34536E

--values color--
#5E5F6A

Projets similaires

Sales Dashboard 2 (Video)

février 13, 2023

Automobile Sales Dashboard

janvier 9, 2023

IMDb Top 250 Dashboard

mars 3, 2023
© Copyright 2025 . Perfect Portfolio | Développé par Rara Theme. Propulsé par WordPress.