Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Malsha
Helper I
Helper I

Help me to get the total number of hours employees worked.

Hi,
I am new to Power BI & DAX. so I need a help to get the total hours of employees worked in weekdays, saturdays & sundays in my dataset.

Malsha_0-1689657054163.png

Final datatable how I need to show in my power bi report should be like this. (as an example)

Malsha_1-1689657157024.png

One employee can work in multiple departments and they can have multiple job roles. they don't have one specific job role. as an example, Jon Bloggs (EMP ID - 8230 as in the above picture) can work as a cleaner in today morning at PR800 department and in the evening can work as a janitor in another department or a same department. 
So I need their total work hours by filtering by the job role and the department.

Here is a picture of my data model.

Malsha_2-1689657548075.png


This is how I need to get the data to above columns.
Employee Name & EMP ID :- Employee Data table
Department :- Subunit table (Subunit ID)
Job Role :- Job Role table (Job Role Name)
Period :- Timesheet table (Timesheet start date / Timesheet end date)

Malsha_3-1689657848513.png

 

I need to get the total worked hours for those columns by using Actual Duration column in the Timesheet data table.

Malsha_4-1689658041714.png

 

I use Duration column to identify the week days and holidays. if there's a S in the Duration column, it's a sick leave.  if there's a in the Duration column, it's a Holiday.  if there's a date in the Duration column, it's a working day. 

can you please help me to get this.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Malsha,

It seems like you want to analyze records based on two date fields, you can take a look at the following blog start, end date part if helps:

Before You Post, Read This: start, end date 
Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @Malsha,

It seems like you want to analyze records based on two date fields, you can take a look at the following blog start, end date part if helps:

Before You Post, Read This: start, end date 
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.