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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
MilanRao06
Advocate I
Advocate I

Custom sorting

Hi,

 

I have below two columns in my data containing the values - Core, Moderate and Breakaway. 

  • Cluster -2017
  • Cluster - 2016

 

In my Visuals, I want the sort order to be Core->Moderate->Breakaway, but orders as Breakaway->Core->Moderate (alphabetically). 

 

What I have done now is created two conditional columns where I am populating the values 1,2,3 based on the values in the respective columns (below logic). I am then using these index columns to achieve the required sort order.

 

 

If(Cluster-2017 = Core, then Cluster2017Index = 1)
elseif(Cluster-2017 = Moderate, then Cluster2017Index = 2)
elseif(Cluster-2017 = Breakaway, then Cluster2017Index = 3)

#Similar approach for Cluster-2016

Is it possible to achieve this using a single column or any other better approach possibe?

 

 

Thanks,

Milan

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @MilanRao06,

 

Based on my research, currently, the only way to achieve custom sort is creating extra conditional column, then sort records based on this conditional column. The conditional column is created according to one specific column, it will create a one to one mapping relationship between these two columns in row level. So, it is not available to sort multiple columns which contain exactly same values though based on a single conditional column.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @MilanRao06,

 

Based on my research, currently, the only way to achieve custom sort is creating extra conditional column, then sort records based on this conditional column. The conditional column is created according to one specific column, it will create a one to one mapping relationship between these two columns in row level. So, it is not available to sort multiple columns which contain exactly same values though based on a single conditional column.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-yulgu-msft

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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