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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Freeseman
Helper II
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?

 

Freeseman_1-1667450345702.png

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Freeseman,

 

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

 

DataInsights_0-1667478880862.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Freeseman
Helper II
Helper II

solved it by changing my shift ident to whole number.

 

Thank you so much @DataInsights 

DataInsights
Super User
Super User

@Freeseman,

 

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

 

DataInsights_0-1667478880862.png

 





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

Proud to be a Super User!




@DataInsights 

Thank you.

 

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

Freeseman_0-1667535171734.png

 

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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