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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Custom Sorting of Tables in Power BI

Hi Team,

I want to sort tables in Power BI based on a custom order instead of the default alphabetical order. Is there any solution or workaround available to achieve this?

Example:-

Sales
Budget
Zero Sales

 

instead of below

 

Budget
Sales
Zero Sales

 

Looking forward to your suggestions.

12 REPLIES 12
v-sdhruv
Community Support
Community Support

Hi @theaskk_1 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @theaskk_1 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Anonymous ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

Anonymous
Not applicable

Hi @DataNinja777 , @pankajnamekar25 ,

  Thanks for response please refere below image and want to sort in data preview not in visual..

theaskk_1_0-1743002000682.png

 

 

 

Hi @Anonymous 

You cannot directly sort tables in data preview. The tables are sorted alphabetically by default.
However you can reference a column to sort another column.

You can refer this for custom sort column
https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi

 

To custom sort the tables-

You can rename the tables by giving numbers to the order of sorting as its prefix
Example:



If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

vaatheeque_0-1743067866265.jpeg

 

 

kleigh
Responsive Resident
Responsive Resident

There is a trick to use homoglyphs...

kleigh_0-1743004548234.png

In the picture above "Apple" is written using the Greek letter Alpha. However, there are big disadvantages to this method. You can't search for the table by typing "Apple". If you have a lot of tables, finding symbols with the right appearance and sort order is difficult. Microsoft may change how different languages are sorted together, meaning your trick sort order is not preserved. It's easy to forget exactly what you did to trick the order, and hard to check it later.

It's an option of last resort, when somebody has demanded a particular order and there's no other way to force it.

kleigh_2-1743005121089.png


You can also achieve a similar effect by adding non-letter characters to the table names. This maybe doesn't look as nice, but carries less problems in actually using the table. I have some tables in my model tagged with things like [LU] for lookups, a marker for field parameters, etc. This doesn't completely override the default sort, but does put the logically similar tables in neat groupings.

kleigh_3-1743005694858.png


This is something to consider if your data model is likely to grow in tables. For three tables, I don't think any of the tricks are worth the hassle.

Anonymous
Not applicable

how to write Greek letter Alpha in table names ?? can you give me some references please

kleigh
Responsive Resident
Responsive Resident

Press Windows and . keys together

kleigh_0-1743066235907.png


Remember you will need to type it this way when referring to the table! So the convenience of having the tables in custom order is probably less than the extra work to actually use the tables. It can also cause problems if more tables are added later. Not every sort order has a good solution with this trick, and renaming tables later can cause problems.

If at all possible, use some prefix and don't change the main part of the name, so it still searches properly. 

Hiding the symbols in the name is a last resort if somebody is insisting on both the order and not adding to the field name.

DataNinja777
Super User
Super User

Hi @Anonymous ,

 

To sort tables in Power BI based on a custom order instead of the default alphabetical order, you can create a supporting column that defines the desired sort order and then use the "Sort by Column" feature. For instance, if you want the order to be "Sales", "Budget", and then "Zero Sales", you can add a new column to your table with numeric values representing this custom sequence. In Power BI Desktop, go to the Data view, select your table, and add a new column with the following DAX formula:

SortOrder = 
SWITCH(
    TRUE(),
    'Table'[Category] = "Sales", 1,
    'Table'[Category] = "Budget", 2,
    'Table'[Category] = "Zero Sales", 3,
    99
)

After creating this column, click on the 'Category' column (the one you're displaying in your visual), go to the ribbon at the top, and choose "Sort by Column" → "SortOrder". This will apply your custom sort order to the visual, showing the categories in the specified sequence rather than in alphabetical order.

 

Best regards,

pankajnamekar25
Super User
Super User

Hello @Anonymous 

 

You can sort tables in Power BI based on a custom order by using the Sort by Column feature

TableSortOrder = DATATABLE(

    "Table Name", STRING,

    "Sort Order", INTEGER,

    {

        {"Sales", 1},

        {"Budget", 2},

        {"Zero Sales", 3}

    }

)

 

Then, in the Model View, select the column containing the table names, go to the Column Tools menu, and choose Sort by Column, selecting the custom order column. This ensures that your tables appear in the specified sequence instead of the default alphabetical order. Let me know if you need further clarification

 

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos, it would be greatly appreciated.

@Anonymous 

if above solution is working for you, please mark it as solution.

Thanks

Anonymous
Not applicable

That is not the solution which i am looking , please refer my image. Thank you

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.