Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi all,
I have a table with a column, Environment with values (Dev, TE1, prod)
When i put that column into a matrix table is comes up as Dev, Prod, TE1. How can i arrange it so TE1 is in the middle and not alphabetical.
Thank you
Solved! Go to Solution.
Hello @Nash2Bos,
Can you please try to add a new column to your table with custom sort order values:
EnvironmentSort =
SWITCH(
'Table'[Environment],
"Dev", 1,
"TE1", 2,
"Prod", 3,
BLANK()
)
Power BI uses the Sort by Column feature to override the default alphabetical sorting of text fields.
By creating a numeric sort column (EnvironmentSort), you can define any custom order you want.
Hope this helps.
Hi @Nash2Bos
An easy way is if you can, you'd create a unique identifier number and then sort the column by it. The index column can be done inside powerquery and then sorted in Power BI. For example,
Then, after you've applied your changes, click sort by column:
Hello, you must create an order column to be able to adjust it to your needs. You'd want to do this directly in Power Query with a conditional column and returning a numeric value.
Then in table view, you select the column to sort and the column tools are enabled. Select "Sort by" by referencing the created column
That will solve your problem
Hi @Nash2Bos
An easy way is if you can, you'd create a unique identifier number and then sort the column by it. The index column can be done inside powerquery and then sorted in Power BI. For example,
Then, after you've applied your changes, click sort by column:
thank you but when i try this, Prod is still in the middle of the matrix table
Hi @Nash2Bos ,
You may need to make sure that the visual sort is set to that column as well.
Hello @Nash2Bos,
Can you please try to add a new column to your table with custom sort order values:
EnvironmentSort =
SWITCH(
'Table'[Environment],
"Dev", 1,
"TE1", 2,
"Prod", 3,
BLANK()
)
Power BI uses the Sort by Column feature to override the default alphabetical sorting of text fields.
By creating a numeric sort column (EnvironmentSort), you can define any custom order you want.
Hope this helps.
But when i put it in the table Prod is still in the middle
This case would not work, it would create a dependency
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 39 | |
| 29 | |
| 24 |