Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi
I have a column with categories (for example: High, Medium, Low) but by default Power BI sorts them alphabetically.
I want them to appear in my visuals as High, Medium, Low (not alphabetical).
I tried using "Sort by Column" option, but it’s not working properly in my case.
Solved! Go to Solution.
Hi @Jaspreet99
In Power BI, text fields sort alphabetically by default. To apply a custom sort order (High >> Medium >> Low):
1. Create a SortOrder column (numeric) like:
High = 1
Medium = 2
Low = 3
2. Create column:
SortOrder =
SWITCH (
TRUE(),
Categories[Category] = "High", 1,
Categories[Category] = "Medium", 2,
Categories[Category] = "Low", 3,
4
)
3. Select the Category column >> Column tools >> Sort by Column >> choose SortOrder.
Now visuals will show High >> Medium >> Low instead of alphabetical.
You solve the problem in two ways. Either in Power Query or in Calculated Column. Better to do this in Power Query if your data model is large in size.
in Power Query,
Add Column >> Conditional Column >> Name the column like "Category Index" and set the value as required.
or to create in Calculated Column
Table View >> Table Tools >> New Columns >>
If this solved your issue, please Give a Kudo and Mark as Solution. Thank You
Or, in Power Query create a numeric column that represents the desired order
= Table.AddColumn(
PreviousStep,
"SortOrder",
each if [Category] = "High" then 1
else if [Category] = "Medium" then 2
else if [Category] = "Low" then 3
else 99
)
Then in Data view select the Category column, sort by Column 'SortOrder'.
Hi @Jaspreet99
In Power BI, text fields sort alphabetically by default. To apply a custom sort order (High >> Medium >> Low):
1. Create a SortOrder column (numeric) like:
High = 1
Medium = 2
Low = 3
2. Create column:
SortOrder =
SWITCH (
TRUE(),
Categories[Category] = "High", 1,
Categories[Category] = "Medium", 2,
Categories[Category] = "Low", 3,
4
)
3. Select the Category column >> Column tools >> Sort by Column >> choose SortOrder.
Now visuals will show High >> Medium >> Low instead of alphabetical.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 8 | |
| 7 | |
| 7 |