cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## Dump time difference between 2 shifts

Hello,

I hope you can help as i am battling to find away to calculate the time difference beween 2 dumps over 2 shifts.

I will explain:

I need a calculation that takes the latest time of shift 1 "Dump_End_Timestamp" and the earliest time of shift 2 "Dump_End_Timestamp" to give me its difference in Minutes. Keeping in mind by selecting the dump location.

Is this possible?

1 ACCEPTED SOLUTION
Super User

Try this measure:

``````Minutes Diff =
VAR vLastDumpShift1 =
CALCULATE (
MAX ( ShiftData[DUMP_END_TIMESTAMP] ),
ShiftData[DUMP_END_SHIFT_IDENT] = 1
)
VAR vFirstDumpShift2 =
CALCULATE (
MIN ( ShiftData[DUMP_END_TIMESTAMP] ),
ShiftData[DUMP_END_SHIFT_IDENT] = 2
)
VAR vResult =
DATEDIFF ( vLastDumpShift1, vFirstDumpShift2, MINUTE )
RETURN
vResult``````

Proud to be a Super User!

3 REPLIES 3
Helper II

solved it by changing my shift ident to whole number.

Thank you so much @DataInsights

Super User

Try this measure:

``````Minutes Diff =
VAR vLastDumpShift1 =
CALCULATE (
MAX ( ShiftData[DUMP_END_TIMESTAMP] ),
ShiftData[DUMP_END_SHIFT_IDENT] = 1
)
VAR vFirstDumpShift2 =
CALCULATE (
MIN ( ShiftData[DUMP_END_TIMESTAMP] ),
ShiftData[DUMP_END_SHIFT_IDENT] = 2
)
VAR vResult =
DATEDIFF ( vLastDumpShift1, vFirstDumpShift2, MINUTE )
RETURN
vResult``````

Proud to be a Super User!

Helper II

Thank you.

This looks like it could be the answer. I however get this message:

Any idea how i should format the date to be able to do the calculation?

Announcements

#### 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.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors