Forum Discussion

FCD's avatar
FCD
Regular Visitor
2 years ago
Solved

Add Variable quantity of columns and transpose data

Dear All, I have a table called table1 with 2 differents columns (called Letter and Type) I wish I can create a new table (table2) from this table containing in the first colum all the distinct Typ...
  • slorin's avatar
    2 years ago

    Hi FCD 

     

    = Table.Combine(
    Table.Group(Your_Source,
    {"Type"},
    {{"Data", each Table.FromRows(
    {{[Type]{0}} & [Letter]},
    {"Type"} & List.Transform({1..Table.RowCount(_)}, each "KW" & Text.From(_)))
    }})
    [Data])

     Stéphane