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
Cado_one
Resolver III
Resolver III

Sort column with repeated values by another column

Hi,

 

I got an issue with a frequent columns sorting error and none of the similar existing topics has been able to solve the problem.

Here comes some explanation :

I have a column which contains many values between 0 and 1. I want to sort this column by an other one who contains integers 0,1,2,3,4,5,6. The problem is that each one of them has repeated values and  the sorting by returns the error "We can't sort the 'Plan achievement' column by 'AreaColorIndex'. There can't be more than one value in 'AreaColorIndex' for the same value in 'PlanAchievement'. Please choose a different column for sorting or update the data in 'AreaColorIndex'.

Please find above a sample looking like my datas :

PlanAchievementAreaColorIndex

0

0
00
0.250
0.130
03
0.993
03
01
0.51

 

How can I get around this issue ?

I'll be glad to read and try any of your ideas !

Thanks in advance,

Cado

 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Cado_one ,

 

The PlanAchievement column has multiple values. For example, in your sample, the column has five 0. So it cannot sort by other column.

You need to add an index column and create a new PlanAchievement column to replace it.

Please refer the following steps.

 

1. Add an index column using Power Query Editor.

 

sort1.jpg

 

2. Then we can create a column. Create a table visual using this column and sort by AreaColorIndex column.

 

New plan Achievement Column = 'Table'[PlanAchievement] + 'Table'[Index] * 0.00000001

 

sort2.jpg

 

sort3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

5 REPLIES 5
v-zhenbw-msft
Community Support
Community Support

Hi @Cado_one ,

 

The PlanAchievement column has multiple values. For example, in your sample, the column has five 0. So it cannot sort by other column.

You need to add an index column and create a new PlanAchievement column to replace it.

Please refer the following steps.

 

1. Add an index column using Power Query Editor.

 

sort1.jpg

 

2. Then we can create a column. Create a table visual using this column and sort by AreaColorIndex column.

 

New plan Achievement Column = 'Table'[PlanAchievement] + 'Table'[Index] * 0.00000001

 

sort2.jpg

 

sort3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

Hi @v-zhenbw-msft ,

 

I come back to you because my need has changed a little. I'm now using some external and calculated tables that are merged (UNION function) with the table where the plan achievement is calculated.

In response, I have to calculate the index column in DAX directly to merged table and it gives me difficulties.

I tried the RANKX function but it doesn't work because I have no column with unic values in the table.

Do you have an idea of how to create this index column in DAX ?

 

Thanks in advance,

Cado

Hi @v-zhenbw-msft 

 

You're solution is tricky but works perfectly as expected. Thank you very much !

I think this will be helpful to other users from the community

 

Have a nice day,

Cado

amitchandak
Super User
Super User

@Cado_one , Sort column need to have the same granularity as sort column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

What do you mean by "granularity" ? I'm sorry my english is quiet limited.

 

Cado

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.