Benjamin has attended:
Power BI DAX course
Bar Chart - "Switch X and Y axis"
Dear all,
I have a table with many columns and have created various graphs out of it with slicers which I would also like to use for the issue I will now explain.
Below an extract from my data set.
Product - Quantity - Sales - GM - Award Status
A - 100 - 1000 - 500 - won
B - 100 - 1000 - 800 - lost
C - 100 - 1000 - 200 - pending
A - 100 - 1000 - 500 - lost
I would now like to put this into a stacked bar chart, with Quantity, Sales, GM on the X axis.
Each bar chart is then supposed to have 3 parts reflecting won, lost, pending.
Using the data in it´s original format does my bar chart bring the Award status on the x axis, which is not what I am looking like. I guess I will need to generate a new "support" table in order to get this done, but I don´t know how.
I hope you can help me with this one.
Thank you
Benjamin
RE: Bar Chart - "Switch X and Y axis"
Hi Benjamin,
Thank you for the forum question.
If I understand you right you need a reference query to turn your data to be able to get the chart you want.
1 Open the query editor.
2 Right click the table in the left pane and click Reference.
3 In the reference query move the Award Status column so it is the first column.
4 Select the Award Status and the Product columns.
5 Right click one of the headings of the selected columns and click Unpivot other columns.
6 On the Home tab in the query editor click Close & Apply.
7 Create a stacked bar chart.
8 Add Attribute to Axes, Award Status to Legend, and Value to Values
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector