none
Pivot Data in PowerQuery and Combine Text RRS feed

  • Question

  • Hi,

    Is there a way to pivot data based on one column and combine the value of other columns seperated through any delimiter in power query?

    INPUT:

    Input

    OUTPUT:

    Output

    I hope I eplained myself

    Thanks in advance

    Thursday, February 5, 2015 2:11 PM

Answers

  • hi,

    I suppose your input table name is Table1. You try to use below code :

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Group = Table.Group(Source, {"ID"}, {{"MaterialCode", each Text.Combine(_[MaterialCode], "|") , type text}, {"UserData", each Text.Combine(_[UserData],"|") , type text}})
    in
        Group

    I hope this to help you.

    Regards,


    • Marked as answer by BerndSPL Thursday, February 5, 2015 5:01 PM
    Thursday, February 5, 2015 3:19 PM

All replies

  • hi,

    I suppose your input table name is Table1. You try to use below code :

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Group = Table.Group(Source, {"ID"}, {{"MaterialCode", each Text.Combine(_[MaterialCode], "|") , type text}, {"UserData", each Text.Combine(_[UserData],"|") , type text}})
    in
        Group

    I hope this to help you.

    Regards,


    • Marked as answer by BerndSPL Thursday, February 5, 2015 5:01 PM
    Thursday, February 5, 2015 3:19 PM
  • Thanks!

    That was exactly what I was looking for!

    Regards

    Thursday, February 5, 2015 5:02 PM