The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Solved! Go to Solution.
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:
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!
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
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
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.
Hi there,
Yes, besides creating a custom sort column, you have a couple of other options to control sort order in Power BI:
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.
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.
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!
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:
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!
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.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
30 |
User | Count |
---|---|
181 | |
82 | |
67 | |
48 | |
44 |