Forum Discussion
Order Stacked bar chart by y-axis
- 4 years ago
There are other creative ways than use the 'Sort' option on the object, which work when the values are positive, but not - when negative.
Anonymous, maybe I didn't explain well enough, but I want to sort the variables inside the stacked bar chart. Regardless, thanks for the effort.
In stacked bar chart, when the values are positive are sorted like: 1 -> 2 -> 3 from 0 value,
for negative values they are sorted in opposite direction - also 1 -> 2 -> 3 from 0 value, but 3 -> 2 ->1 as an example is required.
I found a work-around using SQL - something like this - if the values are positive then 1 to the start of the variable name is given, if, they are negative, then 3 given. Doing all of that just for the sake of custom sorting.
Some statements like this and more:
There could be a way, but currently I see it as limitation in Power Bi. Would be glad if I am wrong.
Hi rihard505 ,
From my testing, I also find a situation. when I choose "year" to be X axis, the chart will not have "sort"option. Even though I choose sort by column, it also keeps its own sort, as your problem is.
But if I choose other column, like "index"column to be X axis, the value,no matter it is positive or negative, they all can sort by what I want.
From my testing perspective, I would consider it a matter of the chart's own limitations.
If I misunderstand your meanings, please let me know in time.
Best regards,
Community Support Team Selina zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly