Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
carlbh
Helper I
Helper I

Errors when changing data type to Date

I wonder if anyone can help. I have just noticed after importing a whole load of data from excel, that PBI is converting my date information to US format when the month is greater than the day.

The data is exported into excel from another source. I have tried setting the data in the excel files to bothe date format and custom format dd/mm/yyy hh:ss before saving and importing. It always appears in PBI as Text format. So when I try to set the column to data type "date" I naively assumed it was doing it correctly. It was only when I tried to do some sorting to look for entries more than 6 months old and cross checked wotht he original spreadsheet that I spotted this issue.

For example it was converting 05/12/2018 to 12/05/2018.

I have checked the locale settings in the PBI file and the associated Query editor and both are set to UK.

 

1 ACCEPTED SOLUTION

@carlbh,

 

You may take a look at https://answers.microsoft.com/en-us/windows/forum/all/win-10-date-format-problem-i-need-ddmmyy-date/....

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @carlbh,

 

Assuming that all the dates are formatted the same way (day/month/year) you could use this code to create a custom column:

 

New_Date = DATE(RIGHT([date],4),MID([date],3,6),LEFT([date],2))

 

You can change the datatype of New_Date to date.

 

Kind regards,

Anonymous
Not applicable

I literally created an account just to thank you!

I am hoping there is a more central solution to this issue, I dont want to have to keep addding a new column like this every time I create a new report.

This is pretty fundamental, surely there is a microsoft solution out there......

@carlbh,

 

You may take a look at https://answers.microsoft.com/en-us/windows/forum/all/win-10-date-format-problem-i-need-ddmmyy-date/....

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.