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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
smjzahid
Helper V
Helper V

Custom sort for legend not working with conditional column

I have a 100% stacked column chart in PBI desktop and on the legends well I have a column with below shown values (Text Values)

 

I do not want this to be sorted using the values in this column. However, I want to sort by using the order shown in below snip (meaning Green one on Top followed by number 2 and then 3 and so forth and so on)  if there is not any number in the table after number 1 then I want the next number to show up which is currently number 5 

 

I have created a conditional column within this table using Power query shown below and then used this column to sort the chart but still its not sorting the way I need 

 

 

smjzahid_0-1680608420970.png

 


image.png

 

smjzahid_1-1680608556054.png

I then went inside the PBI desktop (Table View) and sort this table using the newley cretaed (Custom Sort) column 

 

smjzahid_2-1680608684477.png

what I get is this, I want the Green colour (HSF Accepted by NRG Deliverable Complete) to show on top of the chart. 

What is the alternate way to achieve this 

image.png

2 REPLIES 2
Junaid11
Helper V
Helper V

Hello @smjzahid ,
To sort based on Legend. 

1)Click on the visual and press 3 dots at the top right corner of visuals as shown in picture.

2)Click on the "Sort by" dropdown and select "Value".

3)Choose the sort order as either "Ascending" or "Descending" based on your preference.

4)Click "OK" to apply the changes.

wdeadqwefwe.PNG

NO that will sort on the values in the legends column in this case the legen column is Status and it has values as shown in below snip so its sorting those values alphabetically with ALDE/DPE CEM Review Process starting with A first and followed by other, Thats not my requirement

 

I want the GREEN COLOUR (HSF Accepted by NRG to be the first and then followed by others (please read my requirement above)

 

smjzahid_0-1680613093346.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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