Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Credo
Helper I
Helper I

How to transform a single column hierarchy into multiple columns in power query

Hi

 

How can I transform a single column hierarchy like this 

1Name 1
11Name 11
111Name 111
112Name 112
12Name 12
121Name 121
122Name 122
2Name 2
21Name 21
211Name 211


into something like this

 

1Name 111Name 11112Name 112
1Name 112Name 12121Name 121
1Name 112Name 12122Name 122
2Name 221Name 21211Name 211
2Name 221Name 21212Name 212
2Name 222Name 22221Name 221
2Name 222Name 22222Name 222
1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Credo,

 

You may try adding custom column.

let
    r = _
in
    Table.SelectRows(Source, each Text.StartsWith(r[Column1], [Column1]))
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.