Forum Discussion

zurimae's avatar
zurimae
Frequent Visitor
3 years ago

CONVERTING MINUTES INTO HOURS

HI, i exported a report and instead of keeping the hours/min/seconds, it converted to minutes total.

example....staff time should be 8:45:59 but exported into excel turns it into 31559. do i need to create a new column or can i convert staff time column back into hours and minutes and how do i do either of these options? i would like powerbi to show that this person worked 8hours and 45 min staffed time (in a graph or some other visual). Any help would be great! thanks!

1 Reply

  • There are probably many different ways. Here are a couple:

     

    let
        Seconds = 31559,
        DurationMethod = #time( 0, 0, 0 ) + #duration( 0, 0, 0, Seconds ),
        OfTotalSecondsMethod = Time.From( Seconds / ( 24 * 60 * 60 ) ),
        Output = 
        [
            #"Duration Method" = DurationMethod, 
            #"Of Total Seconds Method" =  OfTotalSecondsMethod
        ]
    in
        Output

     

     

    *Note that of total seconds method is relatively error-prone, so would recommend duration method for most scenarios. From https://learn.microsoft.com/en-us/powerquery-m/time-from: