Forum Discussion

batranikhil's avatar
batranikhil
Frequent Visitor
5 years ago
Solved

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:

 

 

Thanks in advance. 

 

Cheers,

Nikhil

4 Replies

  • Anonymous's avatar
    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.

     

    Here is the .pbix file.

     

    https://nicesoftwaresolutions1-my.sharepoint.com/:u:/g/personal/ameshram_nicesoftwaresolutions_com/Efse7rSbqttDnQugUiF5xsABYkbYfRHn-M0OpRjw6P-dWQ?e=8mpJCN

     

  • Kumail's avatar
    Kumail
    Impactful Individual

    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

    • batranikhil's avatar
      batranikhil
      Frequent Visitor

      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.