The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I tried converting the "Request Target Time" Column to text but it gives the same error of Expression.Error: We couldn't parse the input provided as a Time value. I also tried changing the data type using locale to English (UK) but the error still persist. I just need the value of "8:00", "24:00", etc.
Solved! Go to Solution.
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"