Forum Discussion

slcekala77's avatar
slcekala77
New Member
2 years ago

Show milliseconds from data source with Power Query

Hi,

I'm using PowerQuery to import data that has a time column with the data in this format (as shown in the editor when I select a cell in that column):
19:56:40.0560000 (7:56:40 pm with 56 milliseconds)

 

I want to be able to view the data in that format within PowerQuery.

 

I have searched this community but I haven't found this exact scenario, and I'm new enough that I can't easily extrapolate what I was reading for close but not quite this case to my situation.

 

Thanks in advance for any help.

7 Replies

  • I don't think you can do that precisely.

    I don't think Time includes milliseconds.

    You can set the text string to a duration type, but you will have a leading 0. representing the number of days.

     

     

    let
       Source = #table({"Time"}, {{"19:56:40.0560000"}}),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", type duration}})
    in
        #"Changed Type"

     

     

     

     

     

     

  • That's a recognisable format of native data type of time; Time.From() does the trick.

    • ronrsnfld's avatar
      ronrsnfld
      Icon for Super User rankSuper User

      That is not available in Power Query; only in Power BI

    • slcekala77's avatar
      slcekala77
      New Member

      Thanks for the suggestion.  But Time.From([Timestamp]) yields the same result - it displays without the milliseconds and I'm trying to get it to display in the power query cells with milliseconds.  Ultimately I'll be doing math with those milliseconds.

       

       

      • ronrsnfld's avatar
        ronrsnfld
        Icon for Super User rankSuper User

        I think you are presenting an XY problem.

         

        Doing the math has nothing to do with the format you see in the Power Query cell. Using the duration type will allow you  to see the milliseconds. Using the time type will not. But in either case, the milliseconds will be preserved in the value stored, so there should be no problem doing math.

         

        If you need to see it exactly as you show for some reason, then give it a text type and just use the appropriate conversion functions when you do the math.