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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Maz_0102
Helper I
Helper I

Sort by another column

 

Hello 

 

can please someone advise what I'm doing wrong here

my table has no duplicates 

 

i am trying to sort the stage column by rank column 

 

Maz_0102_0-1785229980158.png

 

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Maz_0102 , [Stage] is blank for all four, but each has a different Rank (1, 2, 3, 4). So the single Stage value blank maps to four different Rank values → Power BI refuses, because it wouldn't know which rank to sort blank by. 

 

Option 1: If Category is unique so instead of Stage, use the Category column
Option 2: Merge Category and Stage and then apply sort

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Maz_0102 , [Stage] is blank for all four, but each has a different Rank (1, 2, 3, 4). So the single Stage value blank maps to four different Rank values → Power BI refuses, because it wouldn't know which rank to sort blank by. 

 

Option 1: If Category is unique so instead of Stage, use the Category column
Option 2: Merge Category and Stage and then apply sort

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
MohamedFowzan1
Impactful Individual
Impactful Individual

Hi @Maz_0102 

If the same Stage value is associated with different Rank values, Power BI won't let you use Sort by Column because each Stage must map to one unique Rank.

If the only inconsistency is for blank stages, you could create a new rank column like this:

Sort Rank =
IF(
ISBLANK('Table'[Stage]),
10000,
'Table'[Rank]
)



One thing to be aware of is that this can sometimes lead to a circular dependency, which is a known issue in certain scenarios.

If that happens, a better approach is to create a separate lookup table (e.g., in Power Query) that contains one row per Stage with its corresponding Rank, then relate or merge it back into your model. This ensures each Stage has a unique Rank and avoids the circular dependency.

and finally the easiest fix would be if you could get the correct stage names populated not having any blank, the above can be used if the blanks are needed to be there

MFelix
Super User
Super User

Hi @Maz_0102 ,

 

The problem is on the rnak 1 to 4. The first question is that when you have blank values you cannot sort the column because the blanks are not recognize, in second place since you have the same value (in this case blank) with different rank that cannot also be done you need to have distinct values for each value in the stage column.

 

What you can do has a workaround is to paste an empty carachter for each of the ID were you want to have blanks basically repeat the empty character the number of times of your ID then you should be abble to do the sorting.

 

You would have the following

1 - EmptyChar

2 - EmptyCharEmptyChar

3 - EmptyCharEmptyCharEmptyChar

4 - EmptyCharEmptyCharEmptyCharEmptyChar

 

This would should has blank but in reality you will have some characters there.

 

Copy the empty character from the link below.

https://www.editpad.org/tool/invisible-character


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors