Forum Discussion

IltisGerry's avatar
IltisGerry
New Member
6 years ago
Solved

Expression.error: converting value to list

Hi,   I'm pretty new to Power Query so I apologize in advance for my basic question. What I want to do: - load csv - filter two columns, so that only relevant times remain (column1 < TIME < co...
  • v-juanli-msft's avatar
    6 years ago

    Hi IltisGerry 

    Right click on the table name, select "create function",

    then edit queries in Advanced editor,

    (time ) => let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fdHRCcAgDATQXfItmJhWG1cp7r9GK0jTcqHgx4EPzZHzJM2SC4tRIuHO88xoHmmkL5PnrrwiMI1eU2DVWe264gas+U8+5g7MotnqYuW/aQMWNj2AhRUMWFhBGFzYQe49jAs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t, time1 = _t, time2 = _t, value = _t]),
            #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}, {"time1", type time}, {"time2", type time}, {"value", Int64.Type}}),
            #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [time1] < time),
            #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [time2] > time),
            #"Calculated Maximum" = List.Max(#"Filtered Rows1"[value]),
            #"Converted to Table" = #table(1, {{#"Calculated Maximum"}})
        in
            #"Converted to Table"

    Then enter time in the format "hh:mm:ss" and invoke, you will get another query.

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.