Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Is there any way of configuring the stacked column chart to sort the stacked groups by value and not by alphabet?
I've found a similar question and a solution here (using the group names and prefixing them; like 1_name, 2_name, etc.): https://community.powerbi.com/t5/Desktop/Modify-the-legend-order/td-p/25337. However, in my case I don't want to define the order myself, I want it to be dynamically sorted based on the value of the measure (highest value on the top).
Here is an example of what I want to achieve:
Solved! Go to Solution.
If you have only one category on X-axis, you can have your Legend column sort by Value column.
If you have multiple catgories on X-axis, this method will not work. You have to manually define the order column in your table.
Regards,
I have a solution for multiple x categories. The thing is that it doesn't change the order for each x, but sort all x by value in the same order, which, for me, is more informative.
for example, when I created a stacked chart with my data, I got this:
Which I think it's not very easily readable. I wanted the first bar to be the one with highest value and the next one in order linke the one chart below (the same data):
To do this, you only need to create a table with summarize, where you will summarize the table where the data is by the legend column and the value column.
New_Table = SUMMARIZE(Table,Legend_Column,Value_Column)
It will depend on your data, but for this to work, every legend needs to have on distinct value, so the new table will have 2 columns e x lines, where x is the number of distinct legends.
Then you create a relationship between the legend_column in the new table with the legend_column in the the original data table.
Then you sort the legend_column in the new table by the value column in the new table.
Then you replace the legend in the stacked chart by the legend column in the new table and you decide wether to classify the legend order ascending or descending on the top right corner (3 dots).
If you have only one category on X-axis, you can have your Legend column sort by Value column.
If you have multiple catgories on X-axis, this method will not work. You have to manually define the order column in your table.
Regards,
This is an old post, so I am wondering has this facility been deprecated? Because I can't see how to do it, what am I missing?
Thanks
On multiple categories x-axis, while preserving the x-axis sort order, I would like to sort the stacked column by value, not alphabet. And doing this dynamically. Any pointer on what calculated column / measure / DAX to do this, rather than manually define the sort order for each x-axis category?
Welcome to the world of Power BI!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |