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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
FilipFireFlyBI
Resolver I
Resolver I

Workschedule starttime sum hours per employee/day/type

Hi all,


I have a large workschedule table (see example blue table) for employees, only with start datetime (so no end datetime)

Now I want to know the scheduled hours per employee/day/type. See the white answer column for what I need.

 

Note that the first column dayscheduleid is a unique number column, ordered from oldest number to number.

 

The solution may be created as a calculated column in M (preferred). A DAX calculated column is also OK. A measure is not preferred.

 

see here the link to the blue table that you can use in PowerBI desktop: https://www.dropbox.com/scl/fi/c6kbneps1701l9u8505iz/Workschedule.xlsx?dl=0&rlkey=9kmaqjcf3tk82o9ezv...

 

Thanks!

 

FilipFireFlyBI_0-1678965206119.png

 

1 ACCEPTED SOLUTION
FilipFireFlyBI
Resolver I
Resolver I

I found a solution myself using
1) create a new Index column

2) add calculated column next row = LOOKUPVALUE(Workschedule[startdatetime],Workschedule[Index],Workschedule[Index] + 1)

please note thet I need some extra logic for when the table goes from employeeID 2100 to the next ID 3500



FilipFireFlyBI_0-1678972607560.png

 

View solution in original post

3 REPLIES 3
FilipFireFlyBI
Resolver I
Resolver I

I found a solution myself using
1) create a new Index column

2) add calculated column next row = LOOKUPVALUE(Workschedule[startdatetime],Workschedule[Index],Workschedule[Index] + 1)

please note thet I need some extra logic for when the table goes from employeeID 2100 to the next ID 3500



FilipFireFlyBI_0-1678972607560.png

 

Idrissshatila
Super User
Super User

Hello @FilipFireFlyBI ,

 

check if this solution would work for your case
https://youtu.be/6JA6uy3ZRBA

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




thanks for fast reply but that was not the solution. 
reason is that in my problem I need the next row. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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