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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Sab
Helper V
Helper V

Duration between thread times

Hello

 

I have a table with some duration data (see the table below). I need to calculate the duration with the following conditions:

 

1. If the time between threads in different tables is overlapping, then the Duration SHOULDN'T be added, but it should just be the duration from Start of the first thread to the End of the last one.

2. If there are pauses at which no thread is running, then the Time in between also SHOULDN'T be counted

3. Of course, the calculation must work for whatever we select on slicers

 

For ex. If we have 10 threads that worked today in the morning for a total of 10 minutes, and then those same threads worked today afternoon for another 20 minutes, and then in the evening some other threads from other tables worked for 40 minutes, then the total for the two selected tables should be: 10 + 20 + 40 = 70 min

 

Thank you!

TitleTable NameThread IDLog Start DateLog Start TimeLog End DateLog End Time
FI_DOCUMENTTable113/31/20234:22:45 AM3/31/20234:22:45 AM
FI_DOCUMENTTable123/31/20234:22:46 AM3/31/20234:22:46 AM
FI_DOCUMENTTable133/31/20234:22:46 AM3/31/20234:22:46 AM
FI_DOCUMENTTable143/31/20234:22:47 AM3/31/20234:22:47 AM
FI_DOCUMENTTable153/31/20234:23:04 AM3/31/20234:23:04 AM
FI_DOCUMENTTable163/31/20234:23:04 AM3/31/20234:23:04 AM
FI_DOCUMENTTable173/31/20234:23:09 AM3/31/20234:23:09 AM
FI_DOCUMENTTable183/31/20234:23:58 AM3/31/20234:23:58 AM
FI_DOCUMENTTable193/31/20234:24:06 AM3/31/20234:24:06 AM
FI_DOCUMENTTable113/31/20235:22:45 AM3/31/20235:22:45 AM
FI_DOCUMENTTable123/31/20235:22:46 AM3/31/20235:22:46 AM
FI_DOCUMENTTable133/31/20235:22:46 AM3/31/20235:22:46 AM
FI_DOCUMENTTable143/31/20235:22:47 AM3/31/20235:22:47 AM
FI_DOCUMENTTable153/31/20235:23:04 AM3/31/20235:23:04 AM
FI_DOCUMENTTable163/31/20235:23:04 AM3/31/20235:23:04 AM
FI_DOCUMENTTable173/31/20235:23:09 AM3/31/20235:23:09 AM
FI_DOCUMENTTable183/31/20235:23:58 AM3/31/20235:23:58 AM
FI_DOCUMENTTable193/31/20235:24:06 AM3/31/20235:24:06 AM
FI_DOCUMENTTable1103/31/20235:24:27 AM3/31/20235:24:27 AM
FI_DOCUMENTTable1113/31/20235:24:46 AM3/31/20235:24:46 AM
FI_DOCUMENTTable1123/31/20235:24:49 AM3/31/20235:24:49 AM
FI_DOCUMENTTable1133/31/20235:26:02 AM3/31/20235:26:02 AM
FI_DOCUMENTTable1143/31/20235:26:45 AM3/31/20235:26:45 AM
FI_DOCUMENTTable1153/31/20235:26:45 AM3/31/20235:26:45 AM
FI_DOCUMENTTable1163/31/20235:26:48 AM3/31/20235:26:48 AM
FI_DOCUMENTTable1173/31/20235:26:49 AM3/31/20235:26:49 AM
FI_DOCUMENTTable1183/31/20235:28:09 AM3/31/20235:28:09 AM
FI_DOCUMENTTable1193/31/20235:28:15 AM3/31/20235:28:15 AM
FI_DOCUMENTTable1203/31/20235:28:18 AM3/31/20235:28:18 AM
FI_DOCUMENTTable1213/31/20235:28:26 AM3/31/20235:28:26 AM
FI_DOCUMENTTable1223/31/20235:28:35 AM3/31/20235:28:35 AM
FI_DOCUMENTTable1233/31/20235:29:58 AM3/31/20235:29:58 AM
FI_DOCUMENTTable1243/31/20235:29:59 AM3/31/20235:29:59 AM
FI_DOCUMENTTable1253/31/20235:30:36 AM3/31/20235:30:36 AM
FI_DOCUMENTTable1263/31/20235:30:47 AM3/31/20235:30:47 AM
FI_DOCUMENTTable1273/31/20235:30:56 AM3/31/20235:30:56 AM
FI_DOCUMENTTable1283/31/20235:31:55 AM3/31/20235:31:55 AM
FI_DOCUMENTTable214/3/20238:07:21 PM4/3/20238:07:21 PM
FI_DOCUMENTTable224/3/20238:07:21 PM4/3/20238:07:21 PM
FI_DOCUMENTTable234/3/20238:07:21 PM4/3/20238:07:21 PM
FI_DOCUMENTTable244/3/20238:07:22 PM4/3/20238:07:22 PM
FI_DOCUMENTTable254/3/20238:07:22 PM4/3/20238:07:22 PM
FI_DOCUMENTTable264/3/20238:07:22 PM4/3/20238:07:22 PM
FI_DOCUMENTTable274/3/20238:07:22 PM4/3/20238:07:22 PM
FI_DOCUMENTTable284/3/20238:07:23 PM4/3/20238:07:23 PM
FI_DOCUMENTTable294/3/20238:07:24 PM4/3/20238:07:24 PM
FI_DOCUMENTTable2104/3/20238:07:24 PM4/3/20238:07:24 PM
6 REPLIES 6
Sab
Helper V
Helper V

Hi @ryan_mayu 

 

This works for the sample data, but we need to take two things into account: 

 

1. Not always the Max thread in the table finishes last, therefore we need to get the Max end time, instead of last value

 

2. When we have the threads from different tables running in parallel, the total shouldn't add the time like it does now!

 

Please consider making a call so we fix this together (check DM) 🙂

 

Thank you!

Sab
Helper V
Helper V

Sab_0-1681820839696.png

 

Sab
Helper V
Helper V

So for the given dataset, the duration should be: (2 -1) + (4-3) + (6-5)

Sab_0-1681768791253.png

 

 

@Sab 

pls check if this is what you want.

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hey Ryan, thanks for taking the time to look at it. Please see the screenshot below. It is doing some extra calculations that are not needed. 

 

We should get only three rows (one for each color)

@Sab 

there was something wrong in the DAX. i have updated it.

1.PNG

pls see the attachement below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.