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
Anonymous
Not applicable

Ordering of Legends in Stack bar chart

Hi Friends,

I have created a stack bar chart. 

 

Blue color denotes to : High

Red color denotes to : Low

Yellow color denotes to : Medium

 

So current ordering is - High, Low, Medium [Ordered Alphabetically]

 

I want to order it like - High, Medium, Low. But I am not able to do so. 

 

Kindly help me out to make it done. Thanks a lot in advance.

 

bhuprakashs_0-1599296963724.png

 

Regards,

Bhu

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Could you please provide some sample data which used in stacked bar chart in order to provide you a proper solution? If the data have the same structure with the one in below screen shot, you can put the Soil Type fields  in Values fields with specific orders just like the part with red mark.

Ordering of Legends in Stack bar chart.JPG

In addition, you can refer the method in the following links.

Modify the legend order

Custom sort order for axis, columns, legends.... in Power BI

Best Regards

Rena

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

View solution in original post

4 REPLIES 4
mussaenda
Super User
Super User

Hi @Anonymous,

 

you can create an index for your legend then use sort column by your index column.

 

2020_09_05_13_55_07_TC_BOM_v1_Power_BI_Desktop.png

 

Hope this helps.

Anonymous
Not applicable

Hi @mussaenda ,

Thanks for your revert.

But I have 3 columns in same table for different stages of Soil Type having High, Medium and Low.

I think your solution will work only for one column. Others 2 will be disordered by sorting index for 1st column.

Is there any other solution using that I can sort 3-4 charts in different stages ???

Thanks.

Hi @Anonymous ,

Could you please provide some sample data which used in stacked bar chart in order to provide you a proper solution? If the data have the same structure with the one in below screen shot, you can put the Soil Type fields  in Values fields with specific orders just like the part with red mark.

Ordering of Legends in Stack bar chart.JPG

In addition, you can refer the method in the following links.

Modify the legend order

Custom sort order for axis, columns, legends.... in Power BI

Best Regards

Rena

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

@Anonymous , You can use the same sort column for all three. But you need have a column like

 

Switch ( True(),

[Col1]="High",1,

[Col1]="Medium",2,

[Col1]="Low",3) // correct the numbers as per need

Step for sort column

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Also, check, you might not need that

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

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.