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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cleolee123
Frequent Visitor

Multiple stacked bar charts in a single view

Hi all,

 

I wish to build a visual similar to the attached picture but instead of the x-axis being the year, I want it to be individual survey questions from my dataset- Q1-Q10. Currently when I try to drag Q1-Q10 into the "axis" pane, only Q1 appears. I tried using the drill down function as well but that did not help. Please advice on what I shoyld do. Thanks so much!!power bi.png

1 ACCEPTED SOLUTION

@cleolee123 you need to unpivot your data to get it work, to unpivot

 

- transform data
- select all the columns except questions table
- right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement, in this case Attribute will be renamed to Question.
- close and apply

To visualize,  add question or attribute on x-axis

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

14 REPLIES 14
v-diye-msft
Community Support
Community Support

Hi @cleolee123 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly. If not, please kindly elaborate more. thanks!

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

Hi @amitchandak Thanks for offerring to help. I'm not looking for a clustered bar chart, multiple stacked bar charts for QA1-QA4 side by side is all i want. Kindly refer to my reply to @parry2k for a screenshot of the sample dataset and what I have tried doing. FYI in this case "1" in the dataset represents "very dissatisfied" and "5" in the dataset represents "very satisfied" Thanks a lot!

@amitchandak not sure how QTR is relevant to the question, it is purely something totally different ask by @cleolee123 . I could be totally wrong.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@cleolee123 not sure why it would show only Q1, share sample data and any measure you used and can take a look.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Thank you so much for offering to help. This is the sample data. As you can see I would like all the qns starting with "A", which will be QA1-QA4 which are the satisfaction qns to be in one view. When i drag QA1-A4 to the axis pane the only qn shown is A1. I'm not sure what "1,2,3,4" represents in the x- axis as wellsatisfaction.pngsatisfaction qn.png Thanks in advance!!

@cleolee123 you need to unpivot your data to get it work, to unpivot

 

- transform data
- select all the columns except questions table
- right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement, in this case Attribute will be renamed to Question.
- close and apply

To visualize,  add question or attribute on x-axis

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k So sorry as I am still very new to power bi how do i select all the columns except for the questions table as the data consists of quite a number of columns. Thanks!!

@cleolee123 by holding the ctrl 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k Thanks so much i can finally see the qns in the same view. However, I have encountered another problem not sure if you are able to help. As you can see the satisfaction score for all the qns are exactly the same. That should not be the case. I suspect it has to do with a problem in my "satisfaction score" column that I created. How i did this was to create a conditional column to define all the "1" in my data as "very dissatisfied" and all the "5" in my data as "very satisfied". Was this where i went wrong and is there a more efficient way to define all the "1" in QA1-A4 as "very dissatisfied" all at once? Many thanks!satisfaction qn.png

@cleolee123 well you are one step closer. This is what I would recommend, put a sample excel sheet with data with the expected output and share it with me, if you provide a sample pbix file that is even better. I can take a look at this and can get you over the line with the challenge/issue you described. it will save time to go back and forth.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k I dont think I am able to attach the excel and pbix file here. Do you mind sharing your personal email so I can send it over. Thanks so much!

@cleolee123 my email is in my signature. Cheers!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k Just sent you the email! Thanks so much for helping

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.