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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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