cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jossy Frequent Visitor
Frequent 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

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

Re: Order of bars in stacked bar chart

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!

7 REPLIES 7
Phil_Seamark Super Contributor
Super Contributor

Re: Order of bars in stacked bar chart

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!

v-jiascu-msft Super Contributor
Super Contributor

Re: Order of bars in stacked bar chart

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.
Jossy Frequent Visitor
Frequent Visitor

Re: Order of bars in stacked bar chart

Darn. Thanks for responding!

Phil_Seamark Super Contributor
Super Contributor

Re: Order of bars in stacked bar chart

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!

Jossy Frequent Visitor
Frequent Visitor

Re: Order of bars in stacked bar chart

Hi. Thanks. Where is that option?

Phil_Seamark Super Contributor
Super Contributor

Re: Order of bars in stacked bar chart

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!

Jossy Frequent Visitor
Frequent Visitor

Re: Order of bars in stacked bar chart

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

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 47 members 1,124 guests
Please welcome our newest community members: