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
Anonymous
Not applicable

How to sort categorical(text) column ?

Hi all, 

 

I need some help with sorting the categorical(text) column.  is there any way to sort the value in one column in order?

 

Less than 5,

6 - 10,

11 - 20

...

over 500

Capture.PNG

 

I have tried switch(true() ....) to make a new column and sort by the new column, it's not working.

 

Many thanks!!

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

HI @Anonymous ,

 

I'm assuming that the groups you have here represent a column on your data, correct?

 

Create a table with the following data:

 

Category Sort
Less than 5 1
6-10 2
11-20 3
21-50 4
51-100 5
101-500 6
Over 500 7

 

Use the sort column to sort the category and relate this table with the column on your data table.

 

Then just use this table on your graph.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

HI @Anonymous ,

 

I'm assuming that the groups you have here represent a column on your data, correct?

 

Create a table with the following data:

 

Category Sort
Less than 5 1
6-10 2
11-20 3
21-50 4
51-100 5
101-500 6
Over 500 7

 

Use the sort column to sort the category and relate this table with the column on your data table.

 

Then just use this table on your graph.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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