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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Syndicate_Admin
Administrator
Administrator

CALCULATE THE TIME BETWEEN EACH EMPLOYEE MANAGEMENT

GOOD DAY COMMUNITY!

I need your help.
From the table below, I must find the time between events segmented by Day and Employee. Here I present a sample of the data, as I receive it, in no established order.
TIEMPO DE GTO.JPG

My goal is the management time that each employee has, understood as time between each event. It is also necessary to segment it by Employee and Day. The difficulty I face is that there is no finished event time data, only the Day and Start Time data.

Assuming that the start time is at 08hs and the end of the day at 14hs, I look for something like the following:

TIEMPO DE GTO 2.JPG

That way, I'll be able to see work time intervals and get daily averages per employee, shift, or sector. It is useful for me to expand the analysis of management and continue learning from this great community.


Here I leave a link to the database, reduced and cleaner than the one used, to serve as an example.
https://docs.google.com/spreadsheets/d/1OwRX-8wjLCg_BmV9Rr3oW4qYSb-XHaRv/edit#gid=1573902123

Best regards. Thanks a lot!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Syndicate_Admin 

 

You can try the following methods.

Column:

Column =
RANKX (
    FILTER (
        'Table',
        [OPERADOR] = EARLIER ( 'Table'[OPERADOR] )
            && [FECHA] = EARLIER ( 'Table'[FECHA] )
    ),
    'Table'[HORA],
    ,ASC)
Column2 =
CALCULATE (
    MAX ( 'Table'[HORA] ),
    FILTER (
        'Table',
        [Column]
            = EARLIER ( 'Table'[Column] ) + 1
            && [OPERADOR] = EARLIER ( 'Table'[OPERADOR] )
            && [FECHA] = EARLIER ( 'Table'[FECHA] ) ) )
TIEMPO = IF([Column2]=BLANK(),BLANK(), [Column2]-[HORA])

vzhangti_0-1645423569232.png

vzhangti_2-1645423640992.png

Is this the result you expect?

 

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.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Syndicate_Admin 

 

You can try the following methods.

Column:

Column =
RANKX (
    FILTER (
        'Table',
        [OPERADOR] = EARLIER ( 'Table'[OPERADOR] )
            && [FECHA] = EARLIER ( 'Table'[FECHA] )
    ),
    'Table'[HORA],
    ,ASC)
Column2 =
CALCULATE (
    MAX ( 'Table'[HORA] ),
    FILTER (
        'Table',
        [Column]
            = EARLIER ( 'Table'[Column] ) + 1
            && [OPERADOR] = EARLIER ( 'Table'[OPERADOR] )
            && [FECHA] = EARLIER ( 'Table'[FECHA] ) ) )
TIEMPO = IF([Column2]=BLANK(),BLANK(), [Column2]-[HORA])

vzhangti_0-1645423569232.png

vzhangti_2-1645423640992.png

Is this the result you expect?

 

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.

Thanks a lot!!
It was a great help to me.

Helpful resources

Announcements
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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.