Forum Discussion
Clustered Bar chart
Hi all,
I am trying to make a clustered bar chart in PowerBI, similar to one that I made in excel, but cant. I have sample data below.
In the chart, I would like to provide the averages of each of these questions split by survey type. In excel, for example, it would be, make a pivot table, the questions in "values" area (summarize values by averages), the actual values in rows and the survey type in columns.
I have tried multiple ways in PowerBI, the closest I have reached is to having the questions as a legend and survey type as rows. Does anyone know how I can interchange this so survey type becomes the legend and the questions become rows?
Sample Data
| Candidates | Date | Q1 score | Q2 score | Q3 score | Country | Department | Survey type |
| 1 | 30/5/2024 | 5 | 4 | 2 | France | Finance | Hired |
| 2 | 20/5/2024 | 3 | 7 | 9 | Belgium | Sales | Rejected |
| 3 | 11/5/2024 | 8 | 3 | 5 | Germany | Sales | Rejected |
| 4 | 28/4/2024 | 5 | 6 | 2 | France | HR | Hired |
| 5 | 15/4/2024 | 8 | 2 | 4 | Belgium | Finance | Rejected |
| 6 | 15/2/2024 | 2 | 8 | 7 | Germany | Finance | Rejected |
| 7 | 06/01/2024 | 7 | 6 | 9 | France | HR | Rejected |
| 8 | 31/5/2024 | 9 | 3 | 3 | Belgium | Sales | Hired |
| 9 | 31/5/2024 | 4 | 9 | 4 | Germany | Sales | Hired |
Thank you!!
- Anonymous2 years ago
sd_09 thanks
He're is a short video that demonstrates how to do the visual you want with the sample of data you provided, tell me if its good for you
9 Replies
- AnonymousNot applicable
Hi sd_09
I don't know if I figured out your need but here is a solution:
With the data you provided:- I went to PowerQuery
- I selected the Q1 score, Q2 score and Q3 score columns
- Right click > "Unpivot only selected columns"
- I got "Attribute" and "Value" columns
Now within PowerBI
- Stacked column chart
OR to be more precise "provide the averages of each of these questions split by survey type"
Does it answer your question?- sd_09Frequent Visitor
Hey Anonymous
Thanks for your response! Unfortunately, when I try to unpivot these columns, it gives me all the columns with error in the data set. Not sure why this is the case? Could it be because of blanks?
- AnonymousNot applicable
Hey sd_09
Its strange because it works with the data sample you provided
I tried by insterting null values in Q-Score columns and the pivot works
Actually if the Q-Score values are null, it seems that the values are not pivoted (and rejected)
If it's not that confidential, don't hesitate to send me a more realistic sample of your data (with all columns) so I can try it better in my side.
Have a nice day