cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dom898
Regular Visitor

Dauer von mehr als 24h anzeigen

Hallo zusammen,

 

Die Flugverspätungen liegen wie in dem Bild dargestell vor:

Dom898_0-1638747879844.png

1. Ich möchte nur die positiven Werte summieren.

2. Die Dauer soll in hh:mm angzeigt werden. Zusätzlich habe ich das Problem, dass wenn der Wert über 24 Stunden z.B 25 Stunden ist es mir nur als 1 Stunde ausgegeben wird.

 

Vielen Dank

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Dom898 

 

I simulated some data, hoping to restore your problem.

1. Calculate the difference in minutes and convert it to time format.

Minute = DATEDIFF([Actual time],[Expected time],MINUTE)
Duration = 
IF (
    ABS ( [Minute] ) > 1440,
    INT ( ( ABS ( [Minute] ) - 1440 ) / 60 ) & ":"
        & ABS ( [Minute] )
            - INT ( ABS ( [Minute] ) / 60 ) * 60,
    INT ( ABS ( [Minute] ) / 60 ) & ":"
        & ABS ( [Minute] )
            - INT ( ABS ( [Minute] ) / 60 ) * 60
)

vzhangti_0-1638937392029.png

 

2. You can determine whether minutes are positive and sum them.

Sum = 
CALCULATE ( SUM ( 'Table'[Minute] ), FILTER ( 'Table', [Minute] > 0 ) )
Sum time = 
IF (
    [Sum] > 1440,
    INT ( ( [Sum] - 1440 ) / 60 ) & ":"
        & [Sum]
            - INT ( ( [Sum] - 1440 ) / 60 ) * 60,
    INT ( [Sum] / 60 ) & ":"
        & [Sum]
            - INT ( [Sum] / 60 ) * 60
)

vzhangti_1-1638937574263.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Dom898 

 

I simulated some data, hoping to restore your problem.

1. Calculate the difference in minutes and convert it to time format.

Minute = DATEDIFF([Actual time],[Expected time],MINUTE)
Duration = 
IF (
    ABS ( [Minute] ) > 1440,
    INT ( ( ABS ( [Minute] ) - 1440 ) / 60 ) & ":"
        & ABS ( [Minute] )
            - INT ( ABS ( [Minute] ) / 60 ) * 60,
    INT ( ABS ( [Minute] ) / 60 ) & ":"
        & ABS ( [Minute] )
            - INT ( ABS ( [Minute] ) / 60 ) * 60
)

vzhangti_0-1638937392029.png

 

2. You can determine whether minutes are positive and sum them.

Sum = 
CALCULATE ( SUM ( 'Table'[Minute] ), FILTER ( 'Table', [Minute] > 0 ) )
Sum time = 
IF (
    [Sum] > 1440,
    INT ( ( [Sum] - 1440 ) / 60 ) & ":"
        & [Sum]
            - INT ( ( [Sum] - 1440 ) / 60 ) * 60,
    INT ( [Sum] / 60 ) & ":"
        & [Sum]
            - INT ( [Sum] / 60 ) * 60
)

vzhangti_1-1638937574263.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Bitte die Beispieldaten in einem benutzbaren Format zur Verfügung stellen. Zum Beispiel eine Tabelle in die Nachricht integrieren, oder einen der Dateiserver Anbieter benutzen. 

 

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors