none
text conversion into date RRS feed

  • Question

  • I have the following date column formatted as text:

    160201

    160202

    160203

    etc.

    What I have to do that powerquery accept it as date format (e.g. YYMMDD)?

    I have tried Date.FromText / Date.From. It did not work....

    help is highly appreciated.


    Tuesday, March 8, 2016 1:03 AM

Answers

All replies

  • The format YYMMDD is not recognized by Power Query. It does recognize YYYYMMDD. You have two options:

    1) Create a custom column and enter the formula Date.FromText("20"&[<dateColumnName>]), or

    2) Modify the existing date column to include the century by adding a new step in M e.g.

        TransformedColumn = Table.TransformColumns(<previousStepName>,{[<dateColumnName>], each "20" & _})


    Tuesday, March 8, 2016 3:00 AM
  • Thanks a lot, that helps. I have tested to use a calendar table and to reference on that
    Thursday, March 10, 2016 9:20 PM