Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to clean the different date format in same column

Dear Community, 

I have a column with date format like these;

the Apr-2019 is the same as Apr-19,  which is month and year.  but I want the date to show the same format in power bi. I have more than 6000 rows, dont want to manual clean it. can someone show a quick way to change it? thank you.

rowdateattribute
row1Apr-2019sales
row2Apr-19forecast
row3May-2019sales 
row4May-19forecast
  • Anonymous , Try to change the data type to date. I think it will convert it into data after that you can choose any format you want from the column property.

     

    For me it became date by default at time of loading

     

    or a new column like

    if(len[date]) =6 , left([date],4) & "20"& right([Date],2), [Date])

     

     

2 Replies

  • Anonymous , Try to change the data type to date. I think it will convert it into data after that you can choose any format you want from the column property.

     

    For me it became date by default at time of loading

     

    or a new column like

    if(len[date]) =6 , left([date],4) & "20"& right([Date],2), [Date])

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak  your code worked, also I found another way(may not be very technical solution), I replaced the - with /1/ to forth the format to the US date format like  Apr/1/19 or Apr/1/2019, 

      thanks again