Forum Discussion

Prasanthke's avatar
Prasanthke
Frequent Visitor
1 year ago
Solved

Date/Time

how to convert the date/time columns in text data type to data and time columns seperately   10-10-2017 21:25  
  • Riny_vE's avatar
    1 year ago

    PQ should recognise such a text and be able to set the data type to Date/Time.

     

    Then, on the Add Column Ribbon and choose Date, Date Only in the From Date & Time group. Repeat that step for the time portion (Time, Time Only).

     

     

     

     

  • Jai-Rathinavel's avatar
    1 year ago

    Hi Prasanthke , Just replace your source query and DateTimeColumn in the below M Code

    let
        Source = YourTable,
        DateColumn = Table.AddColumn(Source, "Date", each Date.From(Text.From([DateTimeColumn]))),
        TimeColumn = Table.AddColumn(DateColumn, "Time", each Time.From(Text.From([DateTimeColumn])))
    in
        TimeColumn

     

    Thanks,

    Jai Rathinavel | LinkedIn

  • v-hjannapu's avatar
    1 year ago

    Hi Prasanthke ,

    Thank you  for reaching out to the Microsoft fabric community forum.

     

    I would also take a moment to thank Jai-Rathinavel and Riny_vE  for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.


    please gothorugh the below official Documentation hope this resolve your Issue.
    https://learn.microsoft.com/en-us/powerquery-m/date-fromtext?

    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

    Best Regards,
    Harshitha.
    Community Support Team