Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Format date from text

I have a column that has years in YYYY text format. I want to convert it to date format (YYYY) Here are the steps that I carried out: 1. I change the data type of the column to text. Let's call thi...
  • v-juanli-msft's avatar
    v-juanli-msft
    7 years ago

    Hi Anonymous 

    If your year column is of text type like 2017, 2018, 2019,

    just convert the data type to number.

    You could use it in the x-axis of a chart.

     

    If you want to create a column like 2017/1/1, 2018/1/1, 2019/1/1

    Just add a custom column

    Text.Combine({Text.From([year], "en-US"), "1/1"}, "/")

    Then convert the data type to date.

     

     

     

    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.