Forum Discussion

wayland's avatar
wayland
Regular Visitor
2 years ago
Solved

Select a column based on a variable

Hi everyone!   I have been struggulling with the database at work and need some help. My date base consists in a table with a column named after days of the year and if the system is operative or i...
  • dufoq3's avatar
    2 years ago

    Hi wayland, at step Parameter you can choose column.

    Is this what you want?

     

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUfIPQCJidaKVnGB8Tz8EBZJwxqbaBZdqV6wSsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [System = _t, #"10/01" = _t, #"11/01" = _t, #"12/01" = _t]),
        Parameter = "12/01",
        StepBack = Source,
        RemovedOtherColumns = Table.SelectColumns(StepBack,{"System", Parameter})
    in
        RemovedOtherColumns