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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rosemilo
Frequent Visitor

Expression.Error: We couldn't parse the input provided as a Time value.

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. 

rosemilo_0-1651830432695.png

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

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"

 

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

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"

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.