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
Anonymous
Not applicable

same column but date is not recognized

i have a column of dates in the excel in this format:

01/1/2016:01:38:19

 

So in powerbi, i spilt the column into date and time but encounter error when i tried changing the data type for date column.

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

 

I tried to reformat to date in excel before importing to powerbi but same error occured.

Anyone can advice?

Thank you.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please split the date column like this in power query.

Capture.PNG

2.PNG

 

For more details, please check the M code as below.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUN9Q3MjA0szIwtDK2sDK0VIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "date", Splitter.SplitTextByEachDelimiter({":"}, QuoteStyle.Csv, false), {"date.1", "date.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"date.1", type date}, {"date.2", type time}})
in
    #"Changed Type1"

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please split the date column like this in power query.

Capture.PNG

2.PNG

 

For more details, please check the M code as below.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUN9Q3MjA0szIwtDK2sDK0VIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "date", Splitter.SplitTextByEachDelimiter({":"}, QuoteStyle.Csv, false), {"date.1", "date.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"date.1", type date}, {"date.2", type time}})
in
    #"Changed Type1"

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi

I will try to use Power Query to split the column into two columns using the split function to fix this issue

Tomas

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.