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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Lora_0121
Helper I
Helper I

How to Customize Sorting

Hello.

 

Can you tell me how to sort categories in text format?

For example, there are categories like low, medium, and high. I want to fix the sort order as medium, high, and low.

I know how to create a table with columns for sort order, create relationships, and then sort by those columns.

 

Is there another way?

I want to know different ways to customize sort order.

 

1 ACCEPTED SOLUTION
Royel
Solution Sage
Solution Sage

Hay @Lora_0121 as you already know the cool way "Sort by Column" to sort any text categorical data like "Low, Medium, High". Here are some other methods you can try:

  • Use calculated column with help of dax 
  • Create a table in Power Query with index or conditional columns 
  • Enter data and then create sort by columns

I think these are the ways to solve sort by categorical columns and you are in good stage. You only know different methods or is there any specefic functionality you want to achieve that, the bese options Sort by Column is not helping you? 

Is it helped? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

6 REPLIES 6
v-nmadadi-msft
Community Support
Community Support

Hi @Lora_0121 

As we haven’t heard back from you, we wanted to kindly follow up to check if the suggestions  provided by the community members for the issue worked. Please feel free to contact us if you have any further questions.

 

Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @Lora_0121 

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @Lora_0121 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

Khashayar
Advocate II
Advocate II

Hi there,

Yes, besides creating a custom sort column, you have a couple of other options to control sort order in Power BI:

  1. Sort by Column in the Same Table
    If your categories are already in a table, you can add a calculated column using DAX that assigns numbers to your text values (for example: Medium = 1, High = 2, Low = 3). Then use Sort by Column to apply the order.

  2. Use a Manual Sort in a Visual
    In some visuals (like bar or column charts), you can manually drag the categories into the order you want by sorting on the axis field — this is limited but useful for small lists.

  3. Leverage a Switch Function in DAX
    You can create a measure with a SWITCH statement to define the order logic. 

Each method depends on whether you want the order to apply just in a visual or consistently across your model.

Hope this helps!

 

Royel
Solution Sage
Solution Sage

Hay @Lora_0121 as you already know the cool way "Sort by Column" to sort any text categorical data like "Low, Medium, High". Here are some other methods you can try:

  • Use calculated column with help of dax 
  • Create a table in Power Query with index or conditional columns 
  • Enter data and then create sort by columns

I think these are the ways to solve sort by categorical columns and you are in good stage. You only know different methods or is there any specefic functionality you want to achieve that, the bese options Sort by Column is not helping you? 

Is it helped? ✔ Give a Kudo • Mark as Solution – help others too!

danextian
Super User
Super User

You've already done it. The column itself can be sorted alphabetically or using a custom sort column or, if together with a measure, the measure itself (eg. sum of sales, transaction count, etc). No other way.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors