Forum Discussion

sanchit's avatar
sanchit
Frequent Visitor
10 years ago
Solved

How to change the date format?

Hi,

For Data: I have imported a .CSV file.

I have two questions?

  1. My Date is in format 1/3/2016 7:56:00 AM (DD/MM/YYYY hh:mm:ss), but PowerBI is reading the Date as MM/DD/YYYY hh:mm:ss.

         How can I change the date format to the desired format?

     2.Another column has date in DD/MM/YYYY (27/08/2016) format but PowerBI is reading it as Text.

  •  While trying to convert it into required format, from Modelling->Data Type in the Report Window, it gives an error “We can’t automatically convert the column to Data Type.”
  • While trying to convert it from Edit Queries -> Transform, output is Error in each cell.

        Some cells have blank data.

This is my first question, please pardon me for the language.

Thank you for the help.

  • sanchit This is controlled by the Locale Setting!

     

    MM/DD/YYYY is the US format (and maybe some other countires not sure???)

     

    But your csv file likely came form a place where they use DD/MM/YYYY

     

    To have PBI recognize those as dates Go to File => Options and settings =>  Options => Locale => change to your country/region

     

14 Replies

  • Sean's avatar
    Sean
    Community Champion

    sanchit This is controlled by the Locale Setting!

     

    MM/DD/YYYY is the US format (and maybe some other countires not sure???)

     

    But your csv file likely came form a place where they use DD/MM/YYYY

     

    To have PBI recognize those as dates Go to File => Options and settings =>  Options => Locale => change to your country/region

     

    • sanchit's avatar
      sanchit
      Frequent Visitor

      Sean Thank you so much :smileyvery-happy: It worked. 

      I was trying it with DAX but in vain , is there a way to solve it using DAX , manually adding a new column with a different date format.

      • Sean's avatar
        Sean
        Community Champion

        sanchit Probably easiest way would be in the Query Editor

         

        Split Column => by delimiter => Custom "/" at each occurence

         

        And then Merge those columns in the "correct" order.

         

        That should work!

  • Why is something as simple as formatting a date so hard in Power BI? Is it that Microsoft is focussing all their development effort on the data engine/ DAX and zero on the development tool? Why do I even have to search "How to format a date in Power BI"? I've been doing this for decades. 

  • How do we change the format of the column header to date format and remaining data to be in number format?

     

    Thanks

    Vinay