0
votes

I'm new to Power BI. I can plot a 100% stacked bar chart flawlessly in Plotly Python. However, when I tried to do the same thing on Power BI, I'm not succeeding.

The plot plot is here: stacked bar chart

The column names are x-labels, the stacks are unique values of the column, the y axis has the count of the stacks for each column.

What fields should I select for axis, legend, values, and tooltips to achieve the same in Power BI?

A snapshot of the data fields in BI is here:fields

All the 23 fields have the same five values: Strongly agree to Strongly disagree, as shown in the legend of the stacked bar chart.

A snapshot of the table. Each row is a survey response from a single respondent. table

1
why your 23 value is separate 23 column? They have to be in one single column with level in another column. Then you can achieve your desired output. If I am wrong, show your table structure with some sample data.mkRabbani
MR @R_R please find the table structure snapshot. I added it to the question. Looking forward to hearing from you! Response to each question of the survey is one single column and each column has 5 options the survey responders can choose to answer. Hence, these are different columns. However, the end goal is to achieve something like the stacked barchart i have attached in the query.sachin kumar s

1 Answers

2
votes

Lets consider 5 column in your table for test purpose as below-

enter image description here

Now you need some transformation in your source data. Select All columns and apply Unpivot Columns from the ribbon's Transformation tab and you will get results as below-

enter image description here

Now get back to report by clicking Close & Apply button, and create this below measure-

count_ = COUNT(your_table_name_1[Value])

Finally configure your 100% Stacked Column Chart as below-

enter image description here

And here is the output (considering 5 questions)-

enter image description here