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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Grouping and sorting of bar chart

Hi,

 

I have the following chart:

 - X-axis: simple Countrows Measure.

 - Y-axis: Departments

 - Legend: Column: Site 

 

The chart is sorted by descending values of the Measure.

Is there a way to group the bars by site? so showing from the top the blue bars first in descending order, and then the green bars in descending order below that.

I don't want to use datagroups because the incoming data might change.

 

Help is much appreciated 😄

 

grts,

 

image.png

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , On in Bar , but you can do that in column bar

Concatenate Label off : https://youtu.be/QgI0vIGIOOk

 

But I think you should be able to apply conditional formatting even on Bar(horizontal) without using Concatenate Label

 

use a measure like

Switch(Max(Table[Site]) ,

"Site 1", "Blue",

"Site 2", "Green",

// add other

"red"

)

 

USe this in conditional formatting using field value option

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Ok, I have done this: Added "Site" to the Y-axis, expanded down in the hierarchy and conditionally formatted using the color-Measure.  Now I can sort the visual by site, so the green bars and blue bars are grouped. But the departments are now sorted alphabetically and not by the value of the Count-measure. Is it possible to have a secondary sort on the visual?

ffd479fe-38fa-429e-86ec-11fe4156e687.png

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors