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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.