Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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!
Solved! Go to 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.
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!
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.
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!
Hi @GKJARC
Please try this solution
simply add all fuel on x axis of bar visual.
try with column chart also
I hope I answered your question!
User | Count |
---|---|
106 | |
86 | |
81 | |
74 | |
71 |
User | Count |
---|---|
112 | |
101 | |
96 | |
74 | |
67 |