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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Days in a row Calculation

Hello everyone,

 

I have a specific case to solve and I need your help after a few hours of trying hard unsuccessfully.

 

Here is the context:

 

I have a Timesheet table which is structured as follows :

Each person puts the number of hours the days they are working OR on leave

 

IDLastnameDateNbHours
1Person A25/08/20228
1Person A26/08/20228
1Person A29/08/20228
2Person B22/08/20228
2Person B29/08/20228
3Person C26/08/20228
3Person C27/08/20228
3Person C28/08/20228
3Person C02/09/20228

 

And I have a "Leave Table" with the leaves for each person :

IDLastnameStart DateEnd Date
1Person A22/08/202226/08/2022
2Person B10/08/202214/08/2022
2Person B20/08/202201/09/2022
3Person C02/09/202205/09/2022

 

 

These tables are obviously simplified ones but this is the idea

The two tables are linked through the ID with a *-* relationship (impossible to do another way)

 

What I need is to list the people that have worked more than 7 days in a row, and show how many days in a row they have been working (if there are multiple periods with more than 7 days for a single person, show the max)

Thing to notice : the people put hours in the timesheet also for their leaves so we need to use the "Leave Table" to not count the dates between Start and End columns

 

In this example, no one works more than 7 days in a row of course but we should have :

IDLastnameMax days in a row
1Person A1
2Person B0
3Person C3

 

 

I hope this is clear enough for you to understand and I hope someone will be able to help me.

 

Thank you in advance !

2 REPLIES 2
amitchandak
Super User
Super User

Anonymous
Not applicable

Hello,

 

Thank you for your reply.

However, the tricky part of my request is to get the "days IN A ROW" which i have no idea how to get it.

The links you sent me don't answer this I believe.

 

Thank you,

Victor

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