Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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 :
PlanAchievement | AreaColorIndex |
0 | 0 |
0 | 0 |
0.25 | 0 |
0.13 | 0 |
0 | 3 |
0.99 | 3 |
0 | 3 |
0 | 1 |
0.5 | 1 |
How can I get around this issue ?
I'll be glad to read and try any of your ideas !
Thanks in advance,
Cado
Solved! Go to Solution.
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.
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
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 @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.
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
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
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
@Cado_one , Sort column need to have the same granularity as sort column
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |