Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I'm looking to create a stacked bar chart with multiple columns from the table. I know I can create a stacked chart with a single column by putting the column name in 'Legend' but is there a way to do that for multiple columns?
Here's the sample survey data:
| S. No. | CIO | IT | LOB |
| 184 | Primary Decision maker | Primary Decision maker | Influencer |
| 684 | Primary Decision maker | Primary Decision maker | Influencer |
| 1082 | Influencer | Influencer | Primary Decision maker |
| 1119 | Influencer | Primary Decision maker | Primary Decision maker |
| 1171 | Influencer | Influencer | Influencer |
| 281 | Primary Decision maker | Primary Decision maker | Primary Decision maker |
| 872 | Primary Decision maker | NA | Primary Decision maker |
| 919 | Primary Decision maker | NA | Influencer |
| 1145 | NA | Primary Decision maker | Primary Decision maker |
| 156 | NA | Primary Decision maker | Primary Decision maker |
| 367 | NA | NA | NA |
| 709 | NA | NA | NA |
And this is the kind of output I'm looking for:
Thanks in advance.
Cheers,
Nikhil
Solved! Go to Solution.
Hello Nikhil,
1)First you need to unpivot all columns except S. No. column in power query editor.
2)Make a summary table grouping by both the columns obtained after unpivoting using count as summarization using Summarize Dax function.
3)Plot the columns of the summary table in a Stacked Column Chart. Output will look as below.
Here is the .pbix file.
Hello Nikhil,
1)First you need to unpivot all columns except S. No. column in power query editor.
2)Make a summary table grouping by both the columns obtained after unpivoting using count as summarization using Summarize Dax function.
3)Plot the columns of the summary table in a Stacked Column Chart. Output will look as below.
Here is the .pbix file.
Great thanks! Unpivot is the key. 🙂
Hello @batranikhil
If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.
You can send the sample .pbix file by adding it to your drive or dropbox and add the link here.
Regards
Kumail Raza
Hi @Kumail - thanks for your response. I am looking to get the above stacked bar chart output as in the image with the table that I pasted above. I couldn't achieve it or havent seen it so don't have a sample so as to what output would look like in *.pbix. Hope I understood your request clearly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |