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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
nbarta
Frequent Visitor

Calculating Weeks With Hours Worked

Hello - I need to calculate the number of weeks Employees have worked either regular or overtime hours. I have two tables - The first I'll call EmployeeData with distinct employee IDs and other relative data, and another I'll call EmployeeHours which is a table that records the daily number of hours containing Employee IDs, Full Date, Week Of Year, Regular Hours, Overtimehours. I need to put the total number of weeks worked into the table with distinct employee IDs. I cannot just count distinct WeekOfYear because sometimes the values of hours worked is 0. 

 

I'm trying to do a calculated column in the EmployeeData table but it's not working: 

EmpWeeksWorkedCalc =
CALCULATE(
    DISTINCTCOUNT('EmployeeHours'[WeekOfYear]),
      SUM('EmployeeHours'[OTHours]) > 0) || 
      SUM('EmployeeHours'[RegularHours>0)) 
 
 
Thanks for any help! 
2 REPLIES 2
Anonymous
Not applicable

Hi, @nbarta 

 

May I ask if your problem is solved? If not resolved, can you provide sample data and your expected output? This will better describe your problem. How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

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

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.

Top Solution Authors
Top Kudoed Authors