Forum Discussion

felbri's avatar
felbri
New Member
3 years ago
Solved

Mit Zeiten rechnen

Hallo,

 

ich habe Zeitstempel im Format tt.mm.yyyy hh:mm:ss. Ich möchte die Dauer zwischen dem ersten und dem zweiten Zeitstempel berechnen lassen. Wenn ich mit SUM arbeite bekomme ich einen langen Wert der nicht dem dem gewünschten Format hh:mm:ss entspricht.

 

Bsp:

Fahrtbeginn = 15.02.2020 07:02:12

Fahrtende    =  15.02.2020 07:08:43

Dauer           = ?

 

Vielen Dank für die Tipps!

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi felbri ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a measure with below dax formula

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Fahrtbeginn] )
    VAR _b =
        SELECTEDVALUE ( 'Table'[Fahrtende] )
    RETURN
        FORMAT ( _b - _a, "hh:nn:ss" )
    

    3. add a table visual with fields and measure 

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi felbri ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a measure with below dax formula

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Fahrtbeginn] )
    VAR _b =
        SELECTEDVALUE ( 'Table'[Fahrtende] )
    RETURN
        FORMAT ( _b - _a, "hh:nn:ss" )
    

    3. add a table visual with fields and measure 

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.