Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to create a TimeKey from a time column in hh:mm:ss format.

Hi team   How can i create a TimeKey column from a Time column in powerquery. The timekey column will be in seconds from 1-86400.  This is similar to creating a datakey eg: 2019-06-13 to 20190613...
  • v-xicai's avatar
    v-xicai
    7 years ago

    Hi,

     

    Enter the Query Editor, click on your query, go to tab "Add Column" -> "Custom Column", enter column name and formula like code below, adjust the code by adding ",Int64.Type". Don't forget to click the "Close & Apply" button.

     

    Time.Hour([Time])*60*60+Time.Minute([Time])*60+Time.Second([Time])

     

     

     

    Best Regards,

    Amy

     

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