Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Change rows to colums

Hello everyone,   i have a table with 3 colums: A   B   C A - serial number B - number 1 or 2 C - serial number Well my task is: A   B(1)  B(2)      C       C Thank you 
  • Jimmy801's avatar
    Jimmy801
    5 years ago

    Hello Anonymous 

     

    the Text.Combine has to be used as pivot-function of your third column. Here an example

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcjRU0lFyAhHOhkqxOjABI5CAEUTACF2FEbKKWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t]),
        #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[B]), "B", "C", each Text.Combine(_,",")
    )
    in
        #"Pivoted Column"

    Copy paste this code to the advanced editor in a new blank query to see how the solution works.

    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun und guten Rutsch 🙂

    Jimmy