Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Johnsnowlife
Helper III
Helper III

Sorting stacks in a Stacked Bar Chart

My data represents holdings of specific instruments in different funds and their market value and realised gain. I am trying to sort the below chart by the total size of the bar descending. Can you please help?  Sorting stacked bar chart.PNGThe bars each represent a different "Code". If I select the "Code" Field in the "Fields" menu and choose to "Sort By Column" and select the Field representing the total of the bar it gives me the below error.Sorting stacked bar chart Error.PNG

In the Data Table for each date there are multiple funds and within each fund are multiple codes. The same code is in multiple funds on each day. 

8 REPLIES 8
sdpollack
New Member

A solution to this would be appreciated.  I to am trying to do exactly what this post decribes.

 

When I add a column for sorting purposes, I can get it sorted as I'd like, but the column is displayed (doubling the data) ruining my chart.  

 

Perhaps there is a way to sort by a "hidden" column that is not displayed?  I can't find it.

Hopefully you have figured it out by now, but I found a way to get around this issue. If you add your total column as "Tooltips", you can then sort by it in the graph.

MFelix
Super User
Super User

Hi @Johnsnowlife,

 

In the visual select on the top right corner the "..." and select the sort order in the chart.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



That only allows me the option of sorting by the "Code" or any of the Stack values. But i want to sort by the total value of all the stacks. 

Hi @Johnsnowlife,

 

You can try to use sort by column function.(it support use other column to sort chart)

 

Reference:

Sort by column in Power BI Desktop

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

That doesn't work. I get the error mentioned in the first post.

Hi @Johnsnowlife,

 

It seems like the sort by column function not works on summary values.

 

Perhaps you can add column to calculate the total, then use it as the sort column.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

By making a 'Total of the stacks', if a different co-hort of stacks are selected, then a new total has to be written.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.