Case Study Walk-Through - Human Resources (Features and DAX)
Case Study Walk-Through - Human Resources (Features and DAX)
Human Resources
(Features and DAX)
HR case study instructions
You are a manager or analyst at a medium-sized company. You have noticed a drop in performance from the
team. You investigate the causes and find that absenteeism is quite a problem. You need to determine how to
help those who are missing work.
You are provided with a Human Resources Absenteeism dataset. You are required to use this
dataset and build a Power BI dashboard. This dashboard will then be used to gather insights and
answer questions regarding employee absenteeism.
PART 1
1 2
Consider the causes we want to investigate
Before we can start building a dashboard, we need to investigate the available information to find the
underlying causes for absenteeism. This will help us determine if there are new features we need to create.
Employee information
An employee may have health-related issues caused by an unhealthy lifestyle. BMI table
A younger, more inexperienced employee may be absent from work after a social weekend.
Is there a pattern of absenteeisms based on the day of the week?
Does the distance an employee needs to travel to work affect their attendance?
The season can affect attendance. Winter months might cause sickness or difficult Absenteeisms
Season
travel conditions. table
What new features must we create?
Let’s see if all the data in our features are in the correct format to be displayed on a dashboard.
When displaying categorical data on a dashboard, it is easier for our audience to understand words, for example,
“Yes” and “No”, instead of binary values 1 and 0.
Education High school (1), graduate (2), postgraduate (3), master and doctor (4).
Employee information
Social drinker Either “yes” (1) or “no” (0).
table
Social smoker Either “yes” (1) or “no” (0).
The following features are displayed as
Month of absence Month number of the year. numerical values
Day of the week Monday (2), Tuesday (3), Wednesday (4), Thursday (5), Friday (6).
Absenteeisms
table A failure to adhere to a previous disciplinary warning relating to absenteeism (yes=1,
Disciplinary failure
no=0).
TEXT DAX queries can be used to calculate the new features we want and make the numerical to text changes.
What new features must we create?
Employee information
BMI table
The formula for BMI (Body Mass Index) is weight in kilograms divided by height in meters squared.
The height is given in centimetres.
Absenteeisms
Season
table
Our data are based on the USA. The seasons for the USA
Month of absence Month number of the year.
are:
Spring: March, April, and May Autumn: September, October, and November
Summer: June, July, and August Winter: December, January, and February
Consider the causes we want to investigate
Some of the information in this tree is included in the dataset. Which features can we create?
Due to children/dependents …
Family-related Due to pets …
Age ≥ …
Due to older family members …
Non-drinker Age < …
Non-smoker Drinker …
< BMI < Smoker …Change format
Absenteeism Medical reasons
BMI < or BMI > …
Create
Unjustified leave …
Tue, Wed, Not winter
Age <
or Thu?
Create
Fri or …
Mon?
Create
Employee_info
Create new features using DAX table BMI
Let’s create the new features for the Employee_info table using DAX.
The new features are BMI, Smoker status, and Education level.
3
2
BMI feature
successfully created
Employee_info
Create new features using DAX table
Smoker
status
IF statement
Social smoker
If Social smoker == 1 then
Smoker "Smoker"
False
==1 "Non-smoker" else
Non-smoker "Non-smoker"
True end if
"Smoker"
Select
Rename “column” to Smoker status and write the DAX query:
1 “New column” 2
Smoker status = IF(Employee_info[Social smoker] == 1, "Smoker", "Non-smoker")
1
2
Smoker status
feature successfully
created
Employee_info
Create new features using DAX table
Education
level
Flowchart
SWITCH statement
Education
Case: True
1 "High school"
Logic tree Pseudocode
False
If Education == 1 then
High school Case: True
2
"Graduate" "High school"
False
else if Education == 2 then
Graduate "Graduate"
Case: True
"Postgraduate" else if Education == 3 then
Postgraduate 3
"Postgraduate"
False else if Education == 4 then
Masters/Doctorate
Case: True "Masters/Doctorate"
4
"Masters/Doctorate"
end if
Education level
feature successfully
created
1
2
Absenteeism
Create new features using DAX table
Season
Flowchart
OPTION 1
IF…ELSE Month of absence
statement
True
== 12
False
"Winter"
Logic tree Pseudocode
True
<3
If Month of absence == 12 or < 3 then
False
Winter "Winter"
True else if Month of absence < 6 then
<6 "Spring"
Spring "Spring"
False else if Month of absence < 9 then
Summer "Summer"
True
<9 "Summer" else then
Autumn "Autumn”
False
"Autumn" end if
Flowchart
OPTION 2
IF…ELSE
statement Month of absence
True True
>= 3 <=5 "Spring"
Logic tree False False Pseudocode
Following the same steps as before, we can now implement either option for the new
feature Season.
Season feature
successfully created
In the next walk-through…
Now that we have created all our features, we are ready for the third part of the case study:
PART 3
Create visuals