Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Error when converting text to date with Power BI

Dear members,

I have a file which contains all the transactions and tickets generated for the last month from our ticketing system. The thing is the column for created time is in text format. Issue happens when i wanted to convert the column to Date. As a result, some fields were successfully converted and some fields have "Error". Please refer the image below After using the first row as headeremove these errors as they will affect my reporting and tracking process. The error message is "DataFormat.Error: We couldn't parse the input provided as a DateTime value". The sample is available here for your reference   Sample Data Set.xls

  • Hey Anonymous ,

     

    for me it worked without any errors with your data.

    Can you tell me the error?

     

    Otherwise this happens for me once in a while when I import data in another locale format, like US format and I'm in Europe.

    Try to import as with locale. Important, you have to do that when the column is still in format text.

    Right click on the column --> Change Type --> Using Locale:

     

    Then chose Date/Time and Locale English (US):

     

    Afterwards he tries to make a datetime field from the US format.

    Let me know if that worked.

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

7 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Anonymous ,

     

    for me it worked without any errors with your data.

    Can you tell me the error?

     

    Otherwise this happens for me once in a while when I import data in another locale format, like US format and I'm in Europe.

    Try to import as with locale. Important, you have to do that when the column is still in format text.

    Right click on the column --> Change Type --> Using Locale:

     

    Then chose Date/Time and Locale English (US):

     

    Afterwards he tries to make a datetime field from the US format.

    Let me know if that worked.

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi selimovd ,

      Thanks, it worked. What i did was changing the regional setting before converting to Date Format.

      • selimovd's avatar
        selimovd
        Icon for Most Valuable Professional rankMost Valuable Professional

        Hey Anonymous ,

         

        that's great to hear! Yes, you have to change it before the conversion, otherwise the error already exists 😊
        Don't forget to mark the post as solution ✔️, like that you help the next person to find the result without reading through the whole conversation.

         

        Best regards and have great Easter

        Denis

    • JASPREETml's avatar
      JASPREETml
      New Member

      In my case I got date column in text format and  I trying to convert the column into the date format .It is able to convert the intial dates but ultimatley when I am scrolling down then there are errors and even my os regional language(english India )  and power bi 's regional language are same and I also even tried this convert date according to locale method but still problem is not getting resolved. 

       

       

       

       

      after applying change data type with locale

    • anoomohan's avatar
      anoomohan
      Icon for Helper III rankHelper III

      I tried changing type using locale, but 2023 gets changed to 1905 year - why is it so?