Forum Discussion
Sort column with repeated values by another column
- 5 years ago
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.00000001If 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