cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted

@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

View solution in original post

7 REPLIES 7
Highlighted
Microsoft
Microsoft

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.

Highlighted

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
Highlighted
Microsoft
Microsoft

@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,

Highlighted

@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?

Highlighted

@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

View solution in original post

Highlighted

@Vvelarde

 

Thanks a lot! That's brilliant work! 🙂

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors