Using this dataset, you can practice these advanced or frequently used features:
1. ๐ Filter Rows Based on Conditions
Use Case: View only employees who worked in “New York”
๐ง Steps:
- Open Power Query Editor.
- Go to the column you want to filter โ for example,
Location. - Click the filter icon in the column header.
- You’ll see a list of values (with checkboxes).
- Either:
- Uncheck all and select New York
- Or choose Text Filters โ Equals, then enter
"New York"and click OK.
โ
Result: Only rows where Location is โNew Yorkโ are kept.
Real-Life Benefit: Helpful when creating location-specific dashboards.
2. ๐ชTime Column Cleaning
- In Power Query Editor, select the
CheckInTimecolumn. - Go to Transform โ Replace Values.
- Replace
.with:- Value to Find:
. - Replace With:
:
9.02.00โ9:02:00, which is valid. - Value to Find:
- Change the Data Type to Time:
- With the column selected, go to Transform โ Data Type โ Time
- Repeat the same steps for the
CheckOutTimecolumn.
โ
Objective: Add a Custom Column HoursWorked
๐ง Steps to Add the HoursWorked Column
- โ
Open Power Query Editor
- In Power BI, go to the Home tab โ Transform Data.
- โ
Ensure Time Columns Are Proper
- Make sure both
CheckInTimeandCheckOutTimeare:- Converted from text to time
- Format should be like:
09:15:00, not9.15.00
- Make sure both
- โ
Go to Add Column Tab
- Click on Add Column โ Custom Column
- โ
Enter Formula for Hours Worked In the dialog that opens:
- New column name:
HoursWorked - Formula:
Duration.TotalHours(Time.From([CheckOutTime]) - Time.From([CheckInTime]))
- New column name:
- โ Click OK
- โ
Change Data Type (Optional)
- After the column is created, you may want to round or change the data type to Decimal Number.
๐ What This Does:
- Converts both times to
Timevalues (if not already). - Subtracts
CheckInTimefromCheckOutTime. Duration.TotalHoursconverts the resulting duration to total hours in decimal format.
Example:
CheckInTime = 09:00:00,CheckOutTime = 17:30:00โHoursWorked = 8.5
3. ๐งพ Group By
Use Case: Calculate total hours worked by each employee across dates.
Steps:
- First, add a Custom Column for
HoursWorked:Duration.TotalHours(Time.From([CheckOutTime]) - Time.From([CheckInTime])) - Go to Transform โ Group By
- Group by:
EmployeeID,Name - Operation: Sum of
HoursWorked
- Group by:
Result: Aggregated hours per employee.
4. ๐งฎ Conditional Column
Use Case: Tag employees as โLateโ if CheckInTime > 09:30 AM
Steps:
- Go to Add Column โ Conditional Column
- If
CheckInTime>09:30โ then “Late” else “On Time”
Result: A new column with values: Late or On Time.
5. ๐ Merge Queries (Self Join to Compare Dates)
Use Case: Join this table to itself to compare if an employee worked on consecutive days.
Steps:
- Duplicate the table in Power Query.
- Merge original and duplicate on
EmployeeIDwhere date = date + 1. - Use merge kind: Inner Join
- Expand to get info for the next day.
Result: Helps in analyzing streaks or consecutive working days.

Ankit Srivastava is an IT trainer, technology educator, and digital skills mentor with expertise in programming, data analytics, AI, and software development. He has successfully trained thousands of learners, with more than 10,000 student enrollments on Udemy. His practical teaching approach empowers students and professionals to build in-demand technical skills. Colorstech channel where Ankit posts video tutorials has more than 8000 Subscribers.