Forum Discussion
Sort column headers from left to right based on number
I have a table with 20 fields. Last x fields are numbers (0, 10, 15, 20, 5).
I expand my table via list function (since I don't know numbers in advance) by typing:
ColNames= Table.ColumnNames ( Table.Combine ( #"Last"[Data] ) ),
Expand1 = Table.ExpandTableColumn ( #"Last", "Data", ColNames ),
I want my numbers sorted from left to right by increasing order. List would mix then (5 is at the end etc). How would I be able to achieve that?
2 Replies
- amitchandak
Super User
davidz106 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.- davidz106
Helper III
I first build a list "Colnames" of All columns in my file.
Sample is:
A
B
C
D
5
10
0
25
15
A B C D are always the same but numbers aren't (numers are not always the same). I would like to sort numbers in increasing order 0->100 and then expand to table but I cannot do that since sorting in list would put number 5 in last place.