0% found this document useful (0 votes)
31 views16 pages

Case Study Walk-Through - Human Resources (Features and DAX)

Uploaded by

kachizih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views16 pages

Case Study Walk-Through - Human Resources (Features and DAX)

Uploaded by

kachizih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Case Study Walk-through:

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.

Dataset Dashboard Insights


Instructions

PART 1

Become familiar with the Consider certain causes we


Load the data in Power BI
dataset want to investigate

Investigate how we can Create new features using


PART 2
create new features DAX

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).

Reason for Code 0: Incomplete submission, Code 1, 2, 3, and 4: Family-related


absence Code 5 – 25, 27, 28: Medical reasons, Code 26: Unjustified leave.

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

Weight The weight of the employee (in kilograms).


The formula for BMI = Weight/(Height/100)^2
Height The height of the employee (in centimetres).

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

Age ≥ Transport Winter …

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.

Rename “column” to BMI and write the DAX query:


Select Display column
1 “New column” 2 3 as an integer
BMI = DIVIDE((Employee_info[Weight]), (Employee_info[Height]/100)^2)

3
2
BMI feature
successfully created
Employee_info
Create new features using DAX table
Smoker
status

IF statement

Logic tree Flowchart Pseudocode

Social smoker
If Social smoker == 1 then
Smoker "Smoker"
False
==1 "Non-smoker" else
Non-smoker "Non-smoker"
True end if

"Smoker"

DAX Smoker status = IF(Employee_info[Social smoker] == 1, "Smoker", "Non-smoker")


Employee_info
Create new features using DAX table
Smoker
status

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

DA Education level = SWITCH(Employee_info[Education], 1, "High school", 2, "Graduate",


X 3, "Postgraduate", 4, "Masters/Doctorate")
Employee_info
Create new features using DAX table
Education
level

Rename “column” to Education level and write the DAX query:


Select
1 “New column” 2 Education level = SWITCH(Employee_info[Education], 1, "High school", 2, "Graduate",
3, "Postgraduate", 4, "Masters/Doctorate")

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

DA Season = IF(OR(Absenteeisms[Month of absence] == 12, Absenteeisms[Month of absence] < 3), "Winter",


IF(Absenteeisms[Month of absence] < 6, "Spring",
X
IF(Absenteeisms[Month of absence] < 9, "Summer", "Autumn")))
Absenteeism
Create new features using DAX table
Season

Flowchart
OPTION 2
IF…ELSE
statement Month of absence

True True
>= 3 <=5 "Spring"
Logic tree False False Pseudocode

True True If Month of absence >= 3 and <=5 then


>= 6 <= 8 "Summer"
Winter "Spring"
False else if Month of absence >= 6 and <= 8 then
False
Spring "Summer"
True True else if Month of absence >=9 and <= 11 then
>=9 <= 11 "Autumn"
Summer "Autumn"
False False else then
Autumn "Winter”
"Winter" end if

DA Season = IF(AND(Absenteeisms[Month of absence] >= 3, Absenteeisms[Month of absence] <=5), "Spring",


IF(AND(Absenteeisms[Month of absence] >= 6, Absenteeisms[Month of absence] <= 8), "Summer",
X
IF(AND(Absenteeisms[Month of absence] >=9, Absenteeisms[Month of absence] <= 11), "Autumn", "Winter")))
Absenteeism
Create new features using DAX table
Season

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

See if you can create the following features on your own:

● Drinker status based on Social drinker (IF);


● Disciplinary status based on Disciplinary failure (IF);
● Weekday based on Day of the week (SWITCH);
● Month based on Month of absence (SWITCH); and
● Absenteeism reason based on Reason for absence (IF…ELSE).

You might also like