Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

From tabular- to compact form

Hi All, 

 

I hope you can help me out.

have a data tabel with two columns representing a hierarchy. I want to merge these two columns into a single column, where the hierarchical structure is kept in the same way as a pivot table works when you move from tabular layout to compact form.

Sample data below: 

 

Lvl 1Lvl 2 Compact form
ChairLegs Chair
ChairSeat   Legs
BedBed frame   Seat
BedMattress Bed
BedLegs   Bed frame
     Mattress
     Legs

 

Any suggestions how to achieve this in PQ?

 

Thanks,

Jacob

  • Hi  Anonymous , 

    As I know, we could merge all value in the same column, but there is no hierarchy in same column in Power Query. If you want to display hierarchy, you could put these field in Row field of Matrix in powerbi.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • why would you want to do that, and how would you then know that Legs is a child of Chair ?

  • dax's avatar
    dax
    Community Support

    Hi  Anonymous , 

    As I know, we could merge all value in the same column, but there is no hierarchy in same column in Power Query. If you want to display hierarchy, you could put these field in Row field of Matrix in powerbi.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.