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.
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.
Solved! Go to Solution.
Hi @Anonymous ,
Please split the date column like this in power query.
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"
Hi @Anonymous ,
Please split the date column like this in power query.
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"
Hi
I will try to use Power Query to split the column into two columns using the split function to fix this issue
Tomas
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |