cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Datagrl Frequent Visitor
Frequent Visitor

Sorting stacks in a Stacked Bar Chart

Hi All,

 

I'm new to PBI, and am hoping you can help me.  I am visualizing data from a satisfaction survey, and am having issues with a stacked bar chart.

 

My data consists of 14 questions with values on a 5-point scale.  Each question is a column, and each survey is a row.

 

I need to have a stacked bar chart that shows how many people responded with each of the five points, so each stack would include:

 

  • Strongly Agree x #responses
  • Agree x #responses
  • N/A x #responses
  • Disagree x #responses
  • Strongly Disagree x #responses

The final result something like this:

Stacked Chart.JPG

 

I've tried using text values and creating COUNTROW measures for each value per question.  I've tried using numeric values and working with the data that way.  No matter what, all the data just stacks up in one bar, or if I move my data to the Axis section, I get no bars.  I've been searching Google and the Power BI site, but I'm not finding instructions for what I'm sure is a pretty basic action.

 

Help?  Please? 🙂  Thanks in advance - I really appreciate it.

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-haibl-msft
Microsoft

Re: Sorting stacks in a Stacked Bar Chart

@Datagrl

 

If you survey table is like below. You can select all columns in this table and click Unpivot Columns in Query Editor.

Sorting stacks in a Stacked Bar Chart_1.jpgSorting stacks in a Stacked Bar Chart_2.jpg

 

With above transformed table, we can use the 100% Stacked bar chart to get the expected report.

Sorting stacks in a Stacked Bar Chart_3.jpg

 

Best Regards,

Herbert

View solution in original post

2 REPLIES 2
Microsoft v-haibl-msft
Microsoft

Re: Sorting stacks in a Stacked Bar Chart

@Datagrl

 

If you survey table is like below. You can select all columns in this table and click Unpivot Columns in Query Editor.

Sorting stacks in a Stacked Bar Chart_1.jpgSorting stacks in a Stacked Bar Chart_2.jpg

 

With above transformed table, we can use the 100% Stacked bar chart to get the expected report.

Sorting stacks in a Stacked Bar Chart_3.jpg

 

Best Regards,

Herbert

View solution in original post

Datagrl Frequent Visitor
Frequent Visitor

Re: Sorting stacks in a Stacked Bar Chart

@v-haibl-msft ~ This solved my issue.  Thank you!!! 🙂

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)