Forum Discussion
Expression.Error: We couldn't parse the input provided as a Time value.
- 4 years ago
24:00 is not a valid time in PQ but 00:00 is. Hence, before apply your conversion step, insert this statement to change 24:00 to 00:00 where Source should be replaced with your previous step
= Table.ReplaceValue(Source,each [Request Target Time],each if [Request Target Time]="24:00"then "00:00" else [Request Target Time],Replacer.ReplaceValue,{"Request Target Time"})See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrCwMjBQitUBsmAMIxMYy9DQyshYKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Request Target Time" = _t]), Custom1 = Table.ReplaceValue(Source,each [Request Target Time],each if [Request Target Time]="24:00"then "00:00" else [Request Target Time],Replacer.ReplaceValue,{"Request Target Time"}), #"Changed Type" = Table.TransformColumnTypes(Custom1,{{"Request Target Time", type time}}) in #"Changed Type"
24:00 is not a valid time in PQ but 00:00 is. Hence, before apply your conversion step, insert this statement to change 24:00 to 00:00 where Source should be replaced with your previous step
= Table.ReplaceValue(Source,each [Request Target Time],each if [Request Target Time]="24:00"then "00:00" else [Request Target Time],Replacer.ReplaceValue,{"Request Target Time"})See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrCwMjBQitUBsmAMIxMYy9DQyshYKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Request Target Time" = _t]),
Custom1 = Table.ReplaceValue(Source,each [Request Target Time],each if [Request Target Time]="24:00"then "00:00" else [Request Target Time],Replacer.ReplaceValue,{"Request Target Time"}),
#"Changed Type" = Table.TransformColumnTypes(Custom1,{{"Request Target Time", type time}})
in
#"Changed Type"