Forum Discussion

ajin's avatar
ajin
Helper II
7 years ago

Date Format Conversion

Hi guys,

 

I have dates in the format of dd-mmm-yy(01-Apr-17), is it possible to convert it to dd-mmm-yyyy(01-Apr-2017) ?

 

Thanks

Ajin

9 Replies

  • PattemManohar's avatar
    PattemManohar
    Community Champion

    You can use "Add Column from Examples" option to enter the format you require in one or two records.  It will detect automatically the required expected format and will populate for all other rows as well. Then replace the old column with new column.

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's cleaner than my solution since you can delete the old column.

    • ajin's avatar
      ajin
      Helper II

      Pat,

       

      This approach is useful, but since my data is large is there a way to do this without adding a new column and changing the existing column( such as how we change the format through modelling)as this might cause performance issues. Plus since this is a date field i would prefer it to remain the same as there are dependencies based on this column. 

       

      Thanks

      Aj 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Use a DAX formula to create a new column:

     

    FORMAT('date'[Date],"dd-mmm-yyyy")

  • Hi Guys,

     

    Both the methods mentioned here involves adding a new column. The reports that I'm working with have huge data, hence I think adding new columns for all date fields might cause performance issues , therefore is there any alternative method of directly changing the column format without adding a new column ?

    • v-danhe-msft's avatar
      v-danhe-msft
      Microsoft Employee

      Hi ajin,

      Based on my research, I am afraid you could not modify the row data in Power BI, I still suggest you to use the Format function to achieve your result.

       

      Regards,

      Daniel He