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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
efforting
New Member

Sort each column individually (over 100 columns)

Hello, 

 

In power query, Is it possible with over 100 rows to sort each column so that all columns are in ascending order? 

 

For example, once I load my data it looks like this: 

 

Column 1Column 2Column 3Column 4Column 5
12345
21111
33234
44452
55523

 

 

Column 1Column 2Column 3Column 4Column 5
11111
22222
33333
44444
55555

 

Thank you. 

1 ACCEPTED SOLUTION
alannavarro
Resolver I
Resolver I

Hello, it worked for me, don´t know about how good or bad the performance might be, hope it helps.

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTICYmMgNgFiU6VYnWiwiCEKBokaQ9Uh1INETaA6IbpBsiBRUyjPFK4+NhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t, #"Column 3" = _t, #"Column 4" = _t, #"Column 5" = _t]),
Custom1 = Table.ToColumns (Source),
Custom2 = List.Transform(Custom1, List.Sort),
Custom3 = Table.FromColumns(Custom2)
in
Custom3

View solution in original post

2 REPLIES 2
efforting
New Member

Thank you. Worked for me too.

alannavarro
Resolver I
Resolver I

Hello, it worked for me, don´t know about how good or bad the performance might be, hope it helps.

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTICYmMgNgFiU6VYnWiwiCEKBokaQ9Uh1INETaA6IbpBsiBRUyjPFK4+NhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t, #"Column 3" = _t, #"Column 4" = _t, #"Column 5" = _t]),
Custom1 = Table.ToColumns (Source),
Custom2 = List.Transform(Custom1, List.Sort),
Custom3 = Table.FromColumns(Custom2)
in
Custom3

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors