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

Percentage of column total in a stacked column chart

Hello, I have an issue with getting the percentages of some values not of the grand total but of column total given some data. In the axis I'm using "months", the legend is "type of sale" and I have two categories in that column (retail and fleets). In value I was using the sum of cuantity "QTY" , but of course I cannot get the % of the column total in the chart. I've been trying to create a measure to help me, I tried        %column total= DIVIDE (
COUNT(Sheet3[TIPO DE VENTAS]),
SUM(Sheet3[QTY]))        but its not working. I would appreciate any help.

 

 

Capture.PNG

 

It should give me the values that are on the table on the left side. Thank you

 

 

Pamela

4 REPLIES 4
Highlighted
Moderator v-qiuyu-msft
Moderator

Re: Percentage of column total in a stacked column chart

Hi @pamebenal,

 

From your description, you would like to calculate the percentage of each stack value divided by total value of each MES6, right? 

 

You can create a measure below: 

 

Measure = DIVIDE(SUM(Table1[QTY]),CALCULATE(SUM(Table1[QTY]),ALLEXCEPT(Table1,'Table1'[MES6])))

 

q3.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pamebenal Frequent Visitor
Frequent Visitor

Re: Percentage of column total in a stacked column chart

Hello @v-qiuyu-msft, thank you very much for your answer. But I am still not getting the right results. With the formula stated I got this:

Capture.PNG

 

The resultas that I should get are the ones you got, but I really dont know what am I making wrong. If there is anything that occurs to you I would really appreciate it. 

 

Thank again,

 

Pamela

Moderator v-qiuyu-msft
Moderator

Re: Percentage of column total in a stacked column chart

Hi @pamebenal,

 

Would you please share pbix file with us? Please remove sensitive data before sharing it. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
emilypoon Regular Visitor
Regular Visitor

Re: Percentage of column total in a stacked column chart

Hi,

 

I am facing the same issue and my column chart cannot display the total of 100% as per our need.

 

I want to have a stack column chart as shown below, with X axis as the "Count of number of PO" and Y axis as period by month.

The total of each stacked column should add up to 100%, and the column height represents the total number of POs.

 

1.PNG

 

 

I put a DAX formula as a measure of calculation for the percentage of KPI.

 

2.PNG

 

 

Finally, I got a chart like the one shown below but the percentage calculation is for all the data (ie. total of all the columns will be 100%, but not 100% for each individual bar.

 

3.PNG

 

 

Is there any solution to solve the above problem?

 

Best regards,

Emily

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 1,327 guests
Please welcome our newest community members: