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
stjimi
Frequent Visitor

Creating a stacked Column chart wiht multiple columns

Hi all, 

I can't seem to work this out. I want to create a stacked column graph where each column in the graph relates to a column in a table.  I want the values in each column to be represented in the stack by percentages.  

For example, I want the Criterion 5 to have 70 percent of the column = '0', 20 percent ='1' , and 10 percent =  '2.' 

 

 

Criterion 1 Criterion 2Criterion 3Criterion 4Criterion 5
10201
20200
21120
11011
02230
33102
01000
10220
12000
11110


I have made it work for one criterion but can't get more than one column. 

stjimi_0-1638423576718.png

Any ideas? 

Cheers! 

4 REPLIES 4
v-yetao1-msft
Community Support
Community Support

Hi @stjimi 

Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regard

Community Support Team _ Ailsa Tao

v-yetao1-msft
Community Support
Community Support

Hi @stjimi 

You need to find a way to combine the column names of your column into one column, otherwise multiple columns will be displayed when added to the stacked Column chart, instead of being displayed in one column.

If possible , could you provide your pbix file ? Because I don’t know how your calculated columns are obtained, so I can’t find a way to deal with them .

 

Best Regard

Community Support Team _ Ailsa Tao

v-yetao1-msft
Community Support
Community Support

Hi @stjimi 

(1)In Power Query , use Unpivot columns to convert the column name to row value , like the screenshot below . To prevent the same row from being hidden, an additional index column needs to be created .

Ailsamsft_0-1638774962545.png

(2)Create a measure to count the number group by column [Attribute] and [Value] .

Count = CALCULATE(COUNT('Table'[Value]),ALLEXCEPT('Table','Table'[Attribute],'Table'[Value]))

(3)Add a 100% stacked column chart , put column [Attribute] in Axis ,  [Value] in Legend , [Count] in Values .

Ailsamsft_1-1638774962546.png

The result is as shown :

Ailsamsft_2-1638774962546.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

Thanks so much Ailsa 
The trouble is that these are calculated columns and so won't let me alter them in pPower Query. Is there a work around? 

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.

Top Solution Authors
Top Kudoed Authors