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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Formatting date with inconsistent input data in same column

Hi all,

 

I'm having trouble formatting a column of date data which has two date formats from the raw data.

 

The input data has a mixture of d/m/yyyy and dd/mm/yyyy

For example there is 2/8/2019 and 13/08/2019

 

Power BI appears not to be able to parse the latter format from text into date format, but can for the former. Below is the error that is returned:

[DataFormat.Error] We couldn't parse the input provided as a Date value.


Could anyone please direct me to a method to clean and transform the data to create a regular, recognisable date format?

Thanks a bunch in advance for your help.

Josh

 

 

8 REPLIES 8
Anonymous
Not applicable

Solution

 

I ended up using the split column function in query editor, split by delimeter "/". The saving grace is that the data is at least always in day/month/year format. So then I have three columns and merge these in a calculator column using the date function.


It works, if somewhat clunky. Feel free to let me know of any better ideas.

Cheers
Josh

mussaenda
Super User
Super User

Hi @Anonymous ,

 

I cannot replicate your issue.

i tried these two dates and they can be formatted in power query. check this:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTWN7DQNzIwtFSK1YlWMtKHcWIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}})
in
    #"Changed Type"
amitchandak
Super User
Super User

In the modeling tab in Model view, is it allowing you to change Format:dd/mm/yyyy?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

There is the option for dd-mmm-yyyy and mm/dd/yy but there is not option for dd/mm/yyyy.

 

I.e. there is not option to have full number date format with day first.

 

To add some clarity to the issue in the image below I've duplicated the column, leaving the first column in text/num format and second in date format (mm/dd/yy) using the modeling ribbon rather than in the query editor.


As you can see it recognoises the ordering on month and day changes depending on whether the original column uses 8 or 08 for the month value.

 

 

.Dates.PNG

 

 

 

Hi @Anonymous ,

 

I disagree.

Mine has this one.

2019_09_04_08_17_14_Untitled_Power_BI_Desktop.png

 

I am using English UK as default language for the report.

 

Anonymous
Not applicable

Hi @mussaenda,

Unfortunately I do not share that luxury... Funny how it even teases me with the two US options. Also, I don't have admin privileges to change my OS system settings from US to UK.

Either way it wouldn't change the formatting issue but I would prefer dd/mm/yy

 

Language.PNG

Anonymous
Not applicable

Hi @Anonymous ,

You can try to change column type with 'using locale' option, it allow you to setting specific data type region to help power bi analysis records:

#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}},"en-gb")

Local date formats in Power BI

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Also this is what the data looks like in Excel. You see some recognised dates and some as text

 

date excel.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors