cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kjartank Regular Visitor
Regular Visitor

Yet another 100% stacked bar chart question.

Hi

 

I have lots of columns that contain the same 3 textual values "Satisfied", "Neither" and "Dissatisfied". Can it be that I have to make a 100% stacked bar chart for each one of the columns?

1 ACCEPTED SOLUTION

Accepted Solutions
Vvelarde Super Contributor
Super Contributor

Re: Yet another 100% stacked bar chart question.

@kjartank

 

Hi, Create a New Table (Modeling --New Table) 

 

TransformTable =
UNION (
SELECTCOLUMNS ( Table4, "Attribute", "Purchase", "Answer", Table4[Purchase] ),
SELECTCOLUMNS ( Table4, "Attribute", "Locale", "Answer"; Table4[Locale] )

............................(WIth your others Columns)


)

 

Now in the visual add like this:

 

Chart.png




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




7 REPLIES 7
dkay84_PowerBI New Contributor
New Contributor

Re: Yet another 100% stacked bar chart question.

What is your question exactly?

 

One option (I think) is that you can unpivot your columns so that you end up 2 columns that contain the original column name (attribute) and the corresponding value.  Then, you could put the column name column as an axis and the values as values and you would get the aggregation (i.e. count, sum, avg etc.) of the 3 textual values for each point on the axis.  This could be a stacked or regular column chart, or 100% stacked if you want.

kjartank Regular Visitor
Regular Visitor

Re: Yet another 100% stacked bar chart question.

The thing is that I can't unpivot them, as they don't show up in my "Edit query" screen. I've written them all, using "SWITCH", from columns with numeric values. The question is basically if I can get more than one column in a chart. I have no problems making one like this.

Stackedsingle.png

 

 

 

What I want to acheive is getting more than one bar in the chart, as I have 11 that I need to visualize in the same space.

 

This is what my data looks like. (+  many rows)

 

PurchaseCheck-outLocaleServiceInformationCleanliness
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Don’t know/ doesn’t applyDissatisfiedDissatisfiedDissatisfiedDissatisfiedDissatisfied
SatisfiedSatisfiedSatisfied SatisfiedSatisfied
SatisfiedSatisfiedDissatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedNeitherSatisfiedDon’t know/ doesn’t applySatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedDissatisfiedSatisfiedNeitherSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Satisfied SatisfiedSatisfiedSatisfiedSatisfied
SatisfiedDissatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
NeitherSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedNeitherSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
      
SatisfiedSatisfiedSatisfiedSatisfiedDon’t know/ doesn’t applySatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedNeitherSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedDissatisfied
SatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Moderator v-sihou-msft
Moderator

Re: Yet another 100% stacked bar chart question.

@kjartank

 

In your current dataset, since you have one column for each category, you can't have it show all categories in a 100% stacked bar chart.

 

For your requirement, you have to change your dataset into 2 rows, one for category (Purchase, Check-out, etc), the other column for result (satisfied, unsatisfied, etc). Then you put the Category column on X-axis, put Result coumn on Legend. Create a measure like "COUNTROWS()" as Values. It will return your expected result.

 

Regards,

kjartank Regular Visitor
Regular Visitor

Re: Yet another 100% stacked bar chart question.

@v-sihou-msft

 

If I'm not sure I understand it correctly. Do you mean that I should make another table, that looks something like this?

 

PurchaseSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Check-outDon’t know/ doesn’t applyDissatisfiedDissatisfiedDissatisfiedDissatisfiedDissatisfied
LocaleSatisfiedSatisfiedSatisfied SatisfiedSatisfied
ServiceSatisfiedSatisfiedDissatisfiedSatisfiedSatisfiedSatisfied
InformationSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
CleanlinessSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfiedSatisfiedNeitherSatisfiedDon’t know/ doesn’t applySatisfied
Check-outSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
LocaleSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
ServiceSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
InformationSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
CleanlinessSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Check-outSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
LocaleSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
ServiceSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
InformationSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
CleanlinessSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Check-outSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
LocaleSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
ServiceSatisfiedSatisfiedDissatisfiedSatisfiedNeitherSatisfied
InformationSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
CleanlinessSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfied SatisfiedSatisfiedSatisfiedSatisfied
Check-outSatisfiedDissatisfiedSatisfiedSatisfiedSatisfiedSatisfied
LocaleSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
ServiceNeitherSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
InformationSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
CleanlinessSatisfiedNeitherSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Check-out      
LocaleSatisfiedSatisfiedSatisfiedSatisfiedDon’t know/ doesn’t applySatisfied
ServiceSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
InformationSatisfiedSatisfiedSatisfiedNeitherSatisfiedSatisfied
CleanlinessSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
PurchaseSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
Check-outSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied
LocaleSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedDissatisfied
ServiceSatisfiedSatisfiedSatisfiedSatisfiedSatisfiedSatisfied

 

 

I'm not sure how that would work.. Would you mind explaining it a bit more in depth?

Vvelarde Super Contributor
Super Contributor

Re: Yet another 100% stacked bar chart question.

@kjartank

 

Hi, Create a New Table (Modeling --New Table) 

 

TransformTable =
UNION (
SELECTCOLUMNS ( Table4, "Attribute", "Purchase", "Answer", Table4[Purchase] ),
SELECTCOLUMNS ( Table4, "Attribute", "Locale", "Answer"; Table4[Locale] )

............................(WIth your others Columns)


)

 

Now in the visual add like this:

 

Chart.png




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




kjartank Regular Visitor
Regular Visitor

Re: Yet another 100% stacked bar chart question.

@Vvelarde

 

Thanks a lot! That's brilliant work! Smiley Happy

kjartank Regular Visitor
Regular Visitor

Re: Yet another 100% stacked bar chart question.

@Vvelarde

 

If I should want to put a filter on the new table, how would I go about that? I want to filter it by the max value of a particular column..

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 31 members 899 guests
Please welcome our newest community members: