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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
krdavies
New Member

Sort data in stacked bar chart by values (unpivoted data)

Hello, I am trying to sort a stacked bar chart where I am tracking the trend in funding from various companies over time. My visual currently looks like this:

 

krdavies_0-1681399149535.png

 

I have been asked to have each column sort so that the largest source of funding for that year is at the bottom with each source of funding stacked on top in order of value of funding received.

 

The underlying data table starts out like this:

 

krdavies_1-1681399241158.png

 

But in order for it to work as a stacked bar chart, I use Power Query to unpivot into this:

 

krdavies_2-1681399295038.png

 

I've tried various other tips for sorting that I've been able to find, but mostly they involve changing the axis sort order, rather than the values themselves. Appreciate any insight!

 

(secondary help needed: can't figure out how to add an attachment to this post 😖)

3 REPLIES 3
KriZo
Resolver II
Resolver II

Why not use the ribbon chart? I would do what you want plus it much easier visually to see the development. 

 

KriZo_0-1681401154158.png

 

 

I've given a sample data set here that is only a small portion of what my actual data set is. When trying this with the full data set it is very visually busy. My manager has a preference for bar charts, and there are several others on the report that we are working on.

Anonymous
Not applicable

Hi @krdavies ,

 

I agree with KriZo, and I think ribbon chart should be a good idea to achieve your goal.

 

As far as I know, currently, Power BI will sort the value by summarizing in stacked bar chart. So your values in each column will be in same sort.


For example, there are five year columns in your visual and there are five category in each year. So Power BI will sort these category by summing value each category instead of sorting in each column individually.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors