Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
batranikhil
Frequent Visitor

Stacked Bar Chart - multiple columns - same chart

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.CIOITLOB
184Primary Decision makerPrimary Decision makerInfluencer
684Primary Decision makerPrimary Decision makerInfluencer
1082InfluencerInfluencerPrimary Decision maker
1119InfluencerPrimary Decision makerPrimary Decision maker
1171InfluencerInfluencerInfluencer
281Primary Decision makerPrimary Decision makerPrimary Decision maker
872Primary Decision makerNAPrimary Decision maker
919Primary Decision makerNAInfluencer
1145NAPrimary Decision makerPrimary Decision maker
156NAPrimary Decision makerPrimary Decision maker
367NANANA
709NANANA

 

And this is the kind of output I'm looking for:

 

IMG_20210701_131402.jpg

 

Thanks in advance. 

 

Cheers,

Nikhil

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

 

Aditya_Meshram_0-1625121688228.png

Here is the .pbix file.

 

https://nicesoftwaresolutions1-my.sharepoint.com/:u:/g/personal/ameshram_nicesoftwaresolutions_com/E...

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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.

 

Aditya_Meshram_0-1625121688228.png

Here is the .pbix file.

 

https://nicesoftwaresolutions1-my.sharepoint.com/:u:/g/personal/ameshram_nicesoftwaresolutions_com/E...

 

Great thanks! Unpivot is the key. 🙂

Kumail
Post Prodigy
Post Prodigy

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.  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.