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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ErickGaitan
Frequent Visitor

Sum hours for night shift employees

Solution: https://community.powerbi.com/t5/Desktop/Shift-that-Goes-into-Next-day/m-p/2690043#M941771

 

Good day community,

I need help, I am trying to sum the total amount of hours worked by each employee, to measeure the complaince, the have a certain amount of hour scheduled. My problem is that could not sum accuratly the hour work by the graveyard agent: They usually start shift at 6.00 pm, 7.00 pm or 9.00 pm. They end the shift the next day but the hours should count in the previous day; which is the nominal day, is there any way to make this possible?

 

IntervalHours
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:001800
9/1/2022 0:301800
9/1/2022 0:301800
9/1/2022 0:301800
9/1/2022 0:301800
9/1/2022 0:300
9/1/2022 0:300
9/1/2022 0:300
9/1/2022 0:300
9/1/2022 0:300
9/1/2022 1:000
9/1/2022 1:000
9/1/2022 1:000
9/1/2022 1:000
9/1/2022 1:000
9/1/2022 1:001800
9/1/2022 1:001800
9/1/2022 1:001800
9/1/2022 1:001800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 1:301800
9/1/2022 20:001800
9/2/2022 20:301800
9/3/2022 21:001800
9/4/2022 21:301800
9/5/2022 22:001800
9/6/2022 22:301800
9/7/2022 23:000
9/8/2022 23:300
9/10/2022 0:000

 

 

7 REPLIES 7
Tony_Kuiper
Helper I
Helper I

Like Dinesh suggests... if your data was :

emp_id, start_time, finish_time

abc, 01/01/2022 18:00, 02/01/2022 07:00

etc your data would be more "friendly" to work with.

Tony_Kuiper
Helper I
Helper I

Personally I would look at capturing the start date/time and the end date/time only per user. The difference between the stamps will give you the hours. You can use the start date (trimmed to date) as the label for the work shift. You need a lot less data than what you appear to have there.

Dinesh_Suranga
Continued Contributor
Continued Contributor

@ErickGaitan ,

Hi,

Do you have columns for start time and end time?

Thank you

I usually split the columns to get the date and the intervals

@ErickGaitan 

Hi,

Does this Interval column show start day or end day?

ex in 1st row it shows 9/1/2022 0:00. Is this start day or end day?

Thank you.

9/1/2022 0:00 this is the start day, it is the first segment of the day, what i am looking for is sum the hours based on the nominal day, when they started the shift

@ErickGaitan 

Hi,

Please share some sample data of your table.

Thank you.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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