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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ftuser
Regular Visitor

Legend Order in vertical bar chart (not order of item but order of legend)

Hi,

 

When using vertical stacked bar chart and put the legend "center right" or "center left", this does not give the same order as for the elements of the graph. It's even the reverse order and it's therefore particularly troublesome for reading (see screenshot).

 

Stacked bar chart legend are reversed in PBIStacked bar chart legend are reversed in PBI

 

I would like to keep the bars as is but reverse the order of the legend only to have a "graphical/natural" corresponding order between legend and chart element.

 

Legend Order is currently :

1) Bottom Values

2) Top Values

 

but I would like to have

1) Top Values

2) Bottom Values

 

Keeping the bottom values bottom in the stack and top values a the top of the stack

 

Regards,

10 REPLIES 10
ftuser
Regular Visitor

Hi and thanks for these elements.

 

Unfortunalty this doesn't work, I try on a test report and the sort order of the reference table doesn't have any influence on chart.

The order of printing category in the stack is ever alphabetical (when sing categories). The only way to change is to change the name of the categories.

 

In a more larger study, In the case of "manual" stacking (pulling some value on Axe Y, we ever have the representation of vertical legend not in adequation with the chart, the first category (bottom of chart) is the "last" category (top of the legend) :

Stacked data  | Current Legend  | Expected Legend
  4           | 1               | 4
  3           | 2               | 3
  2           | 3               | 2
  1           | 4               | 1

 

 

 

 

 

You should use the Legend in your visual from the new table and sort the column in the new table using sort order. It should work. 

Can you share sample .pbix after hiding sensitive data?

 

 

Cheers,
Shishir

Here is an example pbix :

 

https://we.tl/t-RVNnanuxEb

 

As we can see below, the legends are in reverse order of stacked bar chart 

- top left : order ascending based on reference table

- top right : order descending based on reference table

- bottom left : order asending based on reference table (but changing libelle from top to atop to change alphabetical order)

- bottom left : order desending based on reference table (but changing libelle from top to atop to change alphabetical order)

 

illustration.PNG

Hi @ftuser ,

 

Does turning on the Y-axis invert range like this meet your requirements?

vcgaomsft_0-1656553586034.png

vcgaomsft_1-1656554057402.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hi, it's work on certains context.

But

- with this option the x_axes is on top of the graph and this is not always desirable.

- my example was a little bit oversimplified and the need also understand graphs with several value on x-axes. And the draw of vertical-bar are from top to bottom is too confusing for users.

BarChartLegend_moreValueInXaxes.PNG

Thanks for yours ideas,

Regards,

Hi @ftuser ,

 

Yes, this only works in special cases. 😥

Maybe all we can do now is vote for the idea and let the product team add this feature as soon as possible.

Microsoft Idea

 

Best Regards,

Gao

Please re-check the url you provided for pbix.

 

I am unable to download file.

 

 

Cheers,
Shishir

The URL was truncated by the "forum". I have replaced it with a shorter one

Please try with these one : https://we.tl/t-RVNnanuxEb

 

Hello @ftuser ,

 

I dont think we can acheive it. There is already Power BI Idea posted for same.

https://ideas.powerbi.com/ideas/idea/?ideaid=6b6f5485-3c57-4584-96dc-42be252595eb

 

 

Cheers,
Shishir
Shishir22
Solution Sage
Solution Sage

Hello @ftuser ,


Create a Table with two columns like below. But make sure that name of the column is as it is in your data.

 

Shishir22_0-1656335819811.png

 

Sort your Value column as per order using sort by column option shown below-

 

 

Shishir22_1-1656335884496.png

 

Give relationship of this table to your data table on Value column and Legend column in your data.

And pull Value column from your newly created table in legend in place of column you were using from your data table.

 

Please mark it as answer if it resolves your issue. Kudos are also appreciated.

 

Cheers,

Shishir

 

 

Cheers,
Shishir

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.