Forum Discussion

hnguyen76's avatar
hnguyen76
Resolver II
3 years ago
Solved

Create an array from table (Power Query)

Hi guys!   I'm attempting to create an array that has one single input to one single output coming from a table. I currently have a table with multiple columns and I want to map two columns togethe...
  • artemus's avatar
    3 years ago

    Here is a modified version of your query that does this.

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("LYu3DcAwDMB+0ezBXfaYXl4w/P8bYQANBMiBY0gQJwsE72W6IRFfIVonfINknfEdsnXBDyjWFT+hWit+gVo3/IZm3fEHunXwxPsPqjLnBw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
        ToRecords = Table.ToRecords(Source),
        Custom1 = List.Accumulate(ToRecords, [], (current, next) => Record.AddField(current, next[Column2], next[Column3]))
    in
        Custom1