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

View all the Fabric Data Days sessions on demand. View schedule

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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