Forum Discussion
Sort stacked bar chart
Hi everyone!
I’m struggling with sorting a stacked bar chart.
My table contains sales data for different courses (given by course name column) and for several dates.
I want the color blocks of the chart to be sorted from highest to lowest based on percent of grand total of sales.
When I try to sort the column Course names based on column Sales I get the error saying there is more than 1 value of sales for the same value in course names. I cannot sort the column by measures, only by columns. I tried to create a calculated column returning the sum of sales for each course as
Column = CALCULATE ( SUM ( 'Sales'[Sales fact] ), ALLEXCEPT ( 'Sales', 'Sales'[Course name] ) )
But I cannot sort the column with course names by it either, since I get the error about circular dependencies.
What else I can do? Thanks in advance!
2 Replies
- AlBCommunity Champion
or check this out
https://endjin.com/blog/2020/07/quick-tip-updating-the-sort-order-of-a-column-in-power-bi
Please accept the solution when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.