Forum Discussion

bbrauer100's avatar
bbrauer100
New Member
10 years ago

Time to Duration conversion throws an error.

I'm trying to convert time of day to duration in order to perform summary calculations.  However, when I try to convert time to duration in Query Editor the following error occurs:

 

 

DataFormat.Error: We couldn't convert to Duration.
Details:
    1:11:55 AM

Seems pretty straight forward, so what am I missing?

15 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Can you post sample data and your formula? Basically impossible to give you any meaningful feedback otherwise.


  • I have the exact same problem.  The column of input is formatted as date/time, and represents durations in hours:minutes. 

    let
        Source = Excel.Workbook(File.Contents("C:\Users\Me\Documents\Test_Duration_Format.xlsx"), null, true),
        TestColumn_Table = Source{[Item="TestColumn",Kind="Table"]}[Data],
        #"Changed Type" = Table.TransformColumnTypes(TestColumn_Table,{{"TestDuration", type duration}})
    in
        #"Changed Type"

    with the following input:

     

    • BAWard's avatar
      BAWard
      New Member

      Forum didn't accept screen shot in my original reply, and would not let me edit it after it  was  submitted, so here is the sample input.  Hopefully it woks this time.

       

       

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        I have the exact same problem.

         

        Did you find anything that worked?

         

        Thank you

        J