Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Special Transpose to get output

Hi , I need to transpose a dataset to get a specific value. Here is my Input table Below is my output table.   For each ticket in the input table I need to get the key values as colum...
  • Greg_Deckler's avatar
    2 years ago

    Anonymous Can you just Pivot the Key column?

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwVNJRcnQEEoZKsTpwAScgUZKRiizkDFJjZAwVMoJpMzJBFgHpS0xKRhaC6IOKGMNtQxEBaTMyNkEWAmlzdHFGFnIBEmUpSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tickets = _t, Key = _t, Value = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Tickets", Int64.Type}, {"Key", type text}, {"Value", type text}}),
        #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Key]), "Key", "Value")
    in
        #"Pivoted Column"