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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Cannot format column to Date format

Hello

 

I am using an exported CSV as the source.

The Data/Time column is formated this way

 

5/24/23, 12:59:22 PM

 

If I try to format it as Date/Time in the PowerBI Query I get this error


DataFormat.Error: We couldn't parse the input provided as a DateTime value.
Details:
5/24/23, 12:59:22 PM

 

I am using the Regional Settings for English (UK) as I have other sources using this locale.

 

Any ideas on how can I solve this?

 

Thank you in advance

1 ACCEPTED SOLUTION

You're mixing up a few things or I'm misunderstanding you. You don't need to change the locale of your Windows environment or of the "file". You only need to change the column data type and select "use locale" and only that column will be affected:

uselocale.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Then select "date/time" and the right locale.

If you mean that you've appended a bunch of files together and only some of them had the "wrong" locale, then yes that would be a problem. You have to split out the ones that have a different locale and append them after fixing the data type. PowerQuery processes data type operations on the entire column, you can't set a different locale for each cell.

View solution in original post

8 REPLIES 8
HotChilli
Super User
Super User

Right-click (change Type->Using Locale) and select US , datetime.

The format looks like it will be accepted via this feature.

Anonymous
Not applicable

If I change the locale will that not affect all of my other PBIX queries?

Changing data type and using locale only affects that column. 

Anonymous
Not applicable

you are right. I missed that the locale only affected the current file.

Setting it to US resolves it for this data source but breaks it for other sources, sadly 😞

The snapshots below are from another data source after I change the locale from UK to US. They show how the field's values show before and after I change their type to DATE.


It is strange, though, since it seems that it formats it correctly for some date/time entries but not for all.

 

jagostinhoCT_1-1685086259225.pngjagostinhoCT_2-1685086269554.png

 

 

You're mixing up a few things or I'm misunderstanding you. You don't need to change the locale of your Windows environment or of the "file". You only need to change the column data type and select "use locale" and only that column will be affected:

uselocale.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Then select "date/time" and the right locale.

If you mean that you've appended a bunch of files together and only some of them had the "wrong" locale, then yes that would be a problem. You have to split out the ones that have a different locale and append them after fixing the data type. PowerQuery processes data type operations on the entire column, you can't set a different locale for each cell.

Anonymous
Not applicable

I was certainly mixing things up!😊
Learned a couple of new things today. Thank you very much!
Everything formated correctly now after I use the "Using Locale" menu option.

jagostinhoCT_0-1685087574466.png

 



Alternatively, perhaps the comma is the culprit?

Anonymous
Not applicable

good spot.

But this error still comes about after removing the comma

 

DataFormat.Error: We couldn't parse the input provided as a DateTime value.
Details:
5/24/23 12:59:22 PM

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.