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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
davidz106
Helper III
Helper III

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 2
amitchandak
Super User
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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors