Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Convert 'YYYYMDD' to date

Hello everyone,   I am trying to convert a text which is concatenate with different value like '2020128' for 2020 = Year, 1 = January, 28 = Day It works for 2 digits month but for 1 digit month it...
  • v-juanli-msft's avatar
    6 years ago

    Hi Anonymous 

    Add column

     

    Text.Combine({Text.Start(Text.From([date], "en-US"), 4), Text.Middle(Text.From([date], "en-US"), 4, Number.From(Text.Length(Text.From([date], "en-US")))-6), Text.End(Text.From([date], "en-US"), 2)}, "/")

     

    change type

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.