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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors