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

percentages on stacked chart

Hi ,

i have a stacked bar chart, where i want to display percentages insread of values on the data points.

Total bar value is 100% and every color represents its contribution.

PLease find the attached picture.

1 Solution

Accepted Solutions
sunny_talwar

For two expression you can do this:

Expression1:

Expression1/RangeSum(Expression1, Expression2)

Expression2:

Expression2/RangeSum(Expression1, Expression2)

Replace Expression1 and Expression2 with your existing Expressions in your chart.

View solution in original post

10 Replies
sunny_talwar

Assuming this is what your current expression is -? Sum(Sales), try changing it to this:

Sum(Sales)/Sum(TOTAL <FirstDimensionHere> Sales)

alexpanjhc
Specialist
Specialist

Did you try to check the relative in the expression?

Capture.PNG

sunny_talwar

Relative with two dimensions is probably going to calculate the percentage based on the total which probably won't work for Mark

alexpanjhc
Specialist
Specialist

I may not understand what exactly you mean, however, I just tested out a simple example with 2 dimensions and it is based out the total of first dimension when checking relative.(which i think it is your set analysis means)

sunny_talwar

See the difference between the two charts in the image below

Capture.PNG

Top image is using Relative and the bottom one uses this expression -> =Sum(Value)/Sum(TOTAL <Dim1> Value)

Script used:

Table:

LOAD * Inline [

Dim1, Dim2, Value

A, C, 10

A, D, 20

B, C, 15

B, D, 12

];

markgraham123
Specialist
Specialist
Author

Sunny,

Really Thanq verymuch for your time and patience brother.

In my application, the stacked chart is comprised of 2 expressions.

I think that's the reason.

Let me share the application please.

sunny_talwar

For two expression you can do this:

Expression1:

Expression1/RangeSum(Expression1, Expression2)

Expression2:

Expression2/RangeSum(Expression1, Expression2)

Replace Expression1 and Expression2 with your existing Expressions in your chart.

markgraham123
Specialist
Specialist
Author

Thanq Sunny

sunny_talwar

No problem at all Mark