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
GKJARC
Resolver I
Resolver I

Bar chart with multiple columns stacked on Y-axis

Hi everyone,

 

I'm looking for a way to plot a stacked vertical bar chart with months on the X-axis, and fuel used on the Y-asis.
The three different types of used fuel, should be stacked for each month. Power BI however allows max. 1 column in the Y-axis field, whereas in my data table there are is a column for each fuel type so a total of three columns that I'd like to stack on the Y-axis.

The data table is structured like this:

Vehicle Month  FuelA  FuelB  FuelC  FuelTotal
Vehicle 1  Jan  20    0  40  60
Vehicle 1  Feb  10    0  40  50
Vehicle 1  March  30    5  50  85
Vehicle 2  Jan    0    5  30  35
Vehicle 2  Feb    0  10    0  10
Vehicle 2  March  20    0  30  50
Vehicle 3  Jan  40    5  20  65
Vehicle 3  Feb  15    5  30  50

 

So I need fuel types A, B and C stacked into a column for January, another column for February, etc.
On my report page there is a slicer to select Vehicle in case the user wants to look at data of particular vehicle. The vehicle column in the slicer comes from a DIM_Vehicle related by VehicleID to my fuel data table. 

Any help on how to create the bar chart would be much appreciated, thanks!

1 ACCEPTED SOLUTION

Hi @GKJARC 

 

you are right once you add values in stack column chart you wont be able to add legends in same bar/stack. if you want to add legends it will showcase in small multiples.

Uzi2019_0-1711689095075.png

 

 

Unfrotunetly , There is no such option available for bar/stacked column chart. you can either hve multiple value or you can have 1 value with legends. both cannot be possible.

 

I hope I answered your question!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
GKJARC
Resolver I
Resolver I

Thank you @Uzi2019 for your reply. Adding multople rows only works when there is no further categorization in the legend section. I suppose it just isn't possible to make a further distinction by legend in the standard stacked bar chart.

Hi @GKJARC 

 

you are right once you add values in stack column chart you wont be able to add legends in same bar/stack. if you want to add legends it will showcase in small multiples.

Uzi2019_0-1711689095075.png

 

 

Unfrotunetly , There is no such option available for bar/stacked column chart. you can either hve multiple value or you can have 1 value with legends. both cannot be possible.

 

I hope I answered your question!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Uzi2019
Super User
Super User

Hi @GKJARC 
Please try this solution

Uzi2019_0-1711449894031.png


simply add all fuel on x axis of bar visual.
try with column chart also

Uzi2019_1-1711449980294.png

 

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.