Forum Discussion
Dual Sorting for Stacked Bar Chart
- 3 months ago
There is no native workaround that fully solves this. You could create a calculated column or Power Query column that assigns a sort rank based on total value across all dates:
LegendRank = RANKX ( ALL ( 'Table'[LegendField] ), CALCULATE ( SUM ( 'Table'[Value] ) ), , DESC, DENSE )Then sort your legend field by this LegendRank column via Column tools → Sort by column. This will not be dynamic per date (it sorts by overall total), but it gets the highest-value categories to the top of the stack consistently.
There is no native workaround that fully solves this. You could create a calculated column or Power Query column that assigns a sort rank based on total value across all dates:
LegendRank =
RANKX (
ALL ( 'Table'[LegendField] ),
CALCULATE ( SUM ( 'Table'[Value] ) ),
,
DESC,
DENSE
)
Then sort your legend field by this LegendRank column via Column tools → Sort by column. This will not be dynamic per date (it sorts by overall total), but it gets the highest-value categories to the top of the stack consistently.