Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Import changing date

I'm importing data from a website. The date there is in m/d/yyyy. After I pull it in the date becomes m/d/dddd, time, and timezone. When I re-format the time to m/d/yyyy the date then shows up as the day before.  When I format for just date/time, it converts to 5 pm the previous day. Any ideas why this is happening and how do I fix it?

Date upon import

Formatted for just the date

Formatted for just date/time

  • Your datetime is probably coming in UTC, and when it changed to Date in your locale the timezone difference is causing it to change to the previous day.  You can first leave the date field as text and extract text before delimiter at the space before you convert to date.  Not totally sure, but that is likely the issue.

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous 

    On your question

    "Any ideas why this is happening and how do I fix it?"

    Why is marked in black pen and

    How is marked in red pen

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I updated those settings, deleted the query, then re-imported and the problem persists.

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Your datetime is probably coming in UTC, and when it changed to Date in your locale the timezone difference is causing it to change to the previous day.  You can first leave the date field as text and extract text before delimiter at the space before you convert to date.  Not totally sure, but that is likely the issue.

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi  Anonymous 

    This is because the data you have import into power bi is Date/Time/TimeZone type, if you change the data type directly, it will transform with your loacl timezone automatically.

    So just use this way to change the data type as below:

    Selected this column->Transform->Date->Date Only

     

     

    Result:

    This is change data type directly:

    Change data type directly

     

    This is use above way to change data type

    Use above way to change data type

     

    Regards,

    Lin