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
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
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.