I have a column for iteration paths like: iter\2.0, iter\2.0\2.0.1, iter\2.0\2.02,..., iter\2.0\2.10, iter\2.0\2.11.
Now my problem is that these paths are not shown correctly in the visual, no matter what kind of sorting I use.
The display comes like: iter\2.0, iter\2.0\2.01, iter\2.0\2.0.10, iter\2.0\2.0.11,...,iter\2.0\2.0.2, iter\2.0\2.0.3.
The display does not seems correct, instead it should come like this one only: iter\2.0, iter\2.0\2.0.1, iter\2.0\2.02,..., iter\2.0\2.10, iter\2.0\2.11.
Any ideas on how to sort these iterations properly in the visual?
Thanks
Solved! Go to Solution.
As this is a text field, Power BI is sorting them alphabetically. That's why the iter\2.0\2.0.10 comes before iter\2.0\2.0.2.
It understands that 10 comes before 2 because it takes character by character to sort, so 1 comes before 2. Just like in a text.
What you can try to do is to create a column with only the number part and make sure the data type is Number. Then in the Data View, you select your iterator column to be sorted by this new column. Finally, in the visual, when you select "sort by" it will sort by the new column which is sorted numerically and not as a text.
As this is a text field, Power BI is sorting them alphabetically. That's why the iter\2.0\2.0.10 comes before iter\2.0\2.0.2.
It understands that 10 comes before 2 because it takes character by character to sort, so 1 comes before 2. Just like in a text.
What you can try to do is to create a column with only the number part and make sure the data type is Number. Then in the Data View, you select your iterator column to be sorted by this new column. Finally, in the visual, when you select "sort by" it will sort by the new column which is sorted numerically and not as a text.
User | Count |
---|---|
224 | |
79 | |
75 | |
72 | |
53 |
User | Count |
---|---|
186 | |
93 | |
81 | |
76 | |
73 |