Forum Discussion
Sorting in a stacked bar chart
- Anonymous6 years ago
Hi MarcUrdang ,
So assume the picture below is raw visual.
You want the visual sort by legend i.e show as 20200201 c, b, a; 20200102 c, a, b; 20200103 a, b, c; etc... Am i right?
In that case i'm afriad this can't be done in Power BI currently.
About this feature, there are several ideas have been submit , you can vote for them.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/31937392-legend-manual-sorting.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/37921429-sort-order-legend.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi MarcUrdang ,
You can use RANKX() function to create a measure to sort specific column.
Please check the following steps.
1# Create measures as below.
SUM = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[type]="x"))
Measure = RANKX(ALLEXCEPT('Table','Table'[type]),[SUM])2# Add the measure to Tooltips field and sort the visual by the measure.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi .. I don't think I am understanding the steps:
I have a value and a category:
category = branch names or BranchRelated
value = Nashua Page Count
I have created measure #1: but not sure why I have to filter on only ONE of the branches? I probably have this incorrect
Your solution = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[type]="x"))
My solution = from Calculae onwards its underlined in RED
- MarcUrdang6 years ago
Post Patron
I actually now got the calc to work ... but not the sorting
- MarcUrdang6 years ago
Post Patron
- MarcUrdang6 years ago
Post Patron
Hi again .. I don't mean to be rude as I know you have helped me so much thus far .. but as I am now under immense pressure to get this right .. I need to repost so hopefully someone can help me in the next 30 minutes or so.
thanks for your help thus far.
regards,
Marc- Anonymous6 years agoNot applicable
Hi MarcUrdang ,
I'm not sure if i understand you correctly, I thought you want to sort the visual by one of the types in a same column but it turns out that you want sort the visual by multiple columns? If so you may check the topic below.
https://community.powerbi.com/t5/Desktop/Sorting-by-multiple-columns/m-p/536884#M251918.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.