Forum Discussion
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!
- Anonymous3 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
- amitchandak
Super User
felbri , You can get like , if they are in same row
a new column
[Fahrtende] - [Fahrtbeginn]
if they are across row you need earlier
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
- AnonymousNot 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.