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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Total hours per employee, per week

Hi,

 

I've got some time data (daily) and want to check how many hours each employee has per week. My columns are Employee, Hours and Date (from Time_table). I also have a date_table with weeks, months, etc.

 

Visually, I can show this by using Employee on rows and Week for columns, but I need to create a measure that sums the total per week/per employee in order to use said measure as a filter. I want to create a matrix that only shows the employees and the corresponding weeks where they have less than 40 hours.

 

Example: Picture below shows a matrix with Employee name, Week and Hours. I want to filter this to only show employees & weeks with <40 hours. If I try a simple visual filter now (<40), it shows nothing since the total is 246. I understand why this doesn't work, but at the same time, I don't know how to make it work either 🙂

 

 pb.png

So I guess what I'm asking is, how do I sum data based other columns in the dataset (without having to specify which week or which employee, only that it should return totals per employee&week).

 

Thanks in advance (my apologies for the clunkly explanation)

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Maybe a calculated table like this could help.

Table =
SUMMARIZE (
    Table1,
    Table1[Empolyee],
    'Calendar'[Week],
    "Total", SUM ( Table1[Hours] )
)

Total_hours_per_employee_per_week

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Floriankx
Solution Sage
Solution Sage

Hello,

 

 

Usually you just need to Measure1:=SUM(Time_table[hours])

 

Then you relate the date columns.

If you add Measure2:=If([Measure1]<40;[Measure1];Blank())

 

This should work if you have employees and weeks filtered (or in row and column context).

 

v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Maybe a calculated table like this could help.

Table =
SUMMARIZE (
    Table1,
    Table1[Empolyee],
    'Calendar'[Week],
    "Total", SUM ( Table1[Hours] )
)

Total_hours_per_employee_per_week

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.