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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Jossy
Regular Visitor

Order of bars in stacked bar chart

Hi,

 

I have a simple stacked bar chart that has two bars; number of "Y" and the number of "N". The problem is that the "Y" totals far outweigh the "N" totals but the "N" totals are on the bottom. How can I flip the two around?

 

PBI snip.PNG

Thanks,

 

Jossy

 

1 ACCEPTED SOLUTION

Hi @Jossy

 

Create another table that has just 2 columns and 2 rows as follows

 

image.png

 

Create a relationship to this table from your FHG > 0.5 column in your current table.  

 

In the new table highlight the FHG > 0.5 column and use the "Sort by column" to select the other column

 

image.png

 

Now use the FHG > 0.5 column from the new table on the axis of your visual

 

image.png

if you want to change the order of the bars in the columns, just edit the numbers in the Order By column

 

Here is a PBIX file you can play with

 

https://1drv.ms/u/s!AtDlC2rep7a-ojQRqHypfci5RjU6

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

8 REPLIES 8
jgubler
Advocate III
Advocate III

A much easier solution is to reorder the legend.
click the 3 dots at the top right of the visual, then...

jgubler_1-1652302586256.png

 

 

v-jiascu-msft
Employee
Employee

Hi @Jossy,

 

Seems no such option available. Please create an idea here.

Order_of_bars_in_stacked_bar_chart

 

Best Regards,

Dale

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

Darn. Thanks for responding!

Hi There,

 

You can change the order of the bars using the "Sort by Column" feature.  Did you give that a try?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi. Thanks. Where is that option?

Hi @Jossy

 

Create another table that has just 2 columns and 2 rows as follows

 

image.png

 

Create a relationship to this table from your FHG > 0.5 column in your current table.  

 

In the new table highlight the FHG > 0.5 column and use the "Sort by column" to select the other column

 

image.png

 

Now use the FHG > 0.5 column from the new table on the axis of your visual

 

image.png

if you want to change the order of the bars in the columns, just edit the numbers in the Order By column

 

Here is a PBIX file you can play with

 

https://1drv.ms/u/s!AtDlC2rep7a-ojQRqHypfci5RjU6

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Phil - as well as having the best name in the world you are a total superstar! All sorted. Even learnt lots about creating tables and entering data 🙂

 

Sorry it's taken so long to reply - crazy time at work.

 

Phil

Phil_Seamark
Employee
Employee

You can, you just need to use the "sort by column" feature. 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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