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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FewHow
New Member

I want to sort data by value while grouping by category

Hello I just want to know is it possible to group like this 

FewHow_0-1753155593527.png

and the data in group are sorted by value 
is it possible

1 ACCEPTED SOLUTION
Aburar_123
Resolver IV
Resolver IV

Hi @FewHow ,

Please follow the below steps,

Step1 : Create a table like below with required field

Step2 : Hold the shift key and sort Product category column and Sales column (We can sort more than one column by holding shift key)

see the table values are now sorted by Product category and sales now,

Aburar_123_0-1753156611246.png

Step3 : then select the above table and change its visual type to Bar chart, so it will display like below,

Aburar_123_1-1753156804453.png

Please accept it as a solution if it answers your question 🙂

 

View solution in original post

5 REPLIES 5
Aburar_123
Resolver IV
Resolver IV

Hi @FewHow ,

Please follow the below steps,

Step1 : Create a table like below with required field

Step2 : Hold the shift key and sort Product category column and Sales column (We can sort more than one column by holding shift key)

see the table values are now sorted by Product category and sales now,

Aburar_123_0-1753156611246.png

Step3 : then select the above table and change its visual type to Bar chart, so it will display like below,

Aburar_123_1-1753156804453.png

Please accept it as a solution if it answers your question 🙂

 

Thank you for your reply 
I tried your method but I still got chart like this 

FewHow_1-1753157400782.png

FewHow_2-1753157466427.png

When I changed table to cluster chart it seems like the sorting is canceled

Oh I tried again and it worked thank you very much.

Sandip_Palit
Resolver I
Resolver I

Here’s a step-by-step guide on how to do this in Power BI using a Clustered column chart.

 

1. Add Your Data Fields
Y-axis: Drag your numerical value here (e.g., Sales, Count, etc.).

X-axis: This is the key step. First, drag your main grouping field (your Category) to the X-axis. Then, drag the field for the individual bars (e.g., Subcategory or Product) underneath the Category field in the X-axis bucket. This creates the hierarchy.

 

2. Expand the Hierarchy
On the top-right corner of your chart visual, click the "Expand all down one level in the hierarchy" icon. This will display both the main category and the individual bars within it, creating the grouped look.

 

3. Apply the Correct Sorting
Click the More options (...) menu on the top-right corner of the visual.

Select Sort axis.

In the submenu, choose to sort by your value field (the one you placed on the Y-axis).

Finally, make sure to select Sort descending.

 

If this explanation and solution resolve your issue, please like and accept the solution.

Hello thank you for reply 
I already did it and got like this 

FewHow_0-1753156962914.png

it sorted by value but the category is messy, did I do it correctly

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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