Forum Discussion

nataliesmiy1357's avatar
1 year ago
Solved

Time in between Formula

Good afternoon!   I am looking to create a formula/measure to capture how much time is between each row/entry.   I have the AI_Start_Time and then AI_Norm_Time.   I need to make a formula that ...
  • mark_endicott's avatar
    1 year ago

    nataliesmiy1357 - it's not clear how you want to present this, but I've attached a PBIX file with a solution. 

     

    It shows the time in DD:HH:MM:SS format

     

     

    If this works for you please accept as the solution. It helps others with the same challenge. 

  • Jihwan_Kim's avatar
    1 year ago

    Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

     

     

    OFFSET function (DAX) - DAX | Microsoft Learn

     

     

    Difference in seconds CC =
    VAR _normtime = Data[AI_Norm_Time]
    VAR _nextrowstarttime =
        MAXX (
            OFFSET (
                1,
                Data,
                ORDERBY ( Data[Entry Number], ASC ),
                ,
                ,
                MATCHBY ( Data[Entry Number] )
            ),
            Data[AI_Start_Time]
        )
    RETURN
        DATEDIFF ( _normtime, _nextrowstarttime, SECOND )