Forum Discussion

chulpanvl's avatar
chulpanvl
Helper I
4 years ago

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