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

Changing the order of the Legend values without changing the Values order

Hello eveyone ,

 

legend order.PNG

This is my chart and I would ideally want to reverse the order of the the legend so that it aligns to the graph plots. Does anyone know a way to do that?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

I  this visuals there is a responsive action so when you resize the chart the legend is reduce.

 

Taking into account that your data is based on columns of your table you can create a separate table  with the following format.

 

 

Category ID Color
SCS 1 #1A51FF
EQ 2 #F2C80F
HU 3 #00FF1A

 

The colour should match the colour codes you have on your visual, then sort the category by the ID column, add the category to a table visual.

 

sorting.png

 

Add the following measure to your table visual:

Marker = "●"

Now do a condittional formatting based on the color of the previous table.

Background_marker.png

 

 

Also blakn out the table headers, the gridlines and remove the totals, final result is below.

result.png

Check the PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Anonymous ,

 

The legend order is connected to the order of the information you place in your visuals so if the first value is EQ then this will be the first value on your legend, there is no separate ordering for legend purposes, a work waroundis to create a new chart with the reverse order and then reduce the size of it to the maximum until you see only the legend in this option disable the X and Y axis also.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

When you say "reduce the size" do you mean literally? Cause reducing the size changes the size of both the chart and the legend (as opposed to crop like functionality).

 

Could you elaborate if possible? Thanks

 

P.S I tried to create a "no duplicates" table of the variables, but this does not allow me to change the order of the legend display.

P.P.S Please note that the values "EQ", "HU", etc. are separate columns in the tab;e behind the chart.

 

Thanks for your help!

 

Best,

Rasul

Hi @Anonymous ,

 

I  this visuals there is a responsive action so when you resize the chart the legend is reduce.

 

Taking into account that your data is based on columns of your table you can create a separate table  with the following format.

 

 

Category ID Color
SCS 1 #1A51FF
EQ 2 #F2C80F
HU 3 #00FF1A

 

The colour should match the colour codes you have on your visual, then sort the category by the ID column, add the category to a table visual.

 

sorting.png

 

Add the following measure to your table visual:

Marker = "●"

Now do a condittional formatting based on the color of the previous table.

Background_marker.png

 

 

Also blakn out the table headers, the gridlines and remove the totals, final result is below.

result.png

Check the PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks!

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.