Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mhassinger
Creator
Creator

Percent change in bar chart

I have a bar chart which shows sales by year. Each bar is a simple Sum(Sales) expression.

As a value on the data point, I want to not only display the dollar amount, but also the percentage change from the last year.

So if my sales were: 2012 = 50, 2013 = 75, 2014 = 60, I'd want to see the following three values over each bar:

$50 / N/A     $75 / +50%     $60 / -20%

I have created a 2nd expression and disabled bar, kept show value on data point, but I'm not quite getting the right set analysis and formula to get the correct percentage to show.

Any ideas?

8 Replies
venkatg6759
Creator III
Creator III

Try similar to the below expression to get both the % and $ amount in the chart

dual(Sum({<Date={'2012','2013','2014'}>}Sales)&' ('& num(Sum({<Date={'2012','2013','2014'}>}Sales)/Sum(sales),('##%'))& ')',

Sum({<Date={'2012','2013','2014'}>}Sales)+(Sum({<Date={'2012','2013','2014'}>}Sales))/100)

rustyfishbones
Master II
Master II

Do you mean like this

2014-06-05_2013.png

rustyfishbones
Master II
Master II

sorry I mean this

2014-06-05_2019.png

mhassinger
Creator
Creator
Author

Close! I need the 50% and -20% to be next to the 75 and 60. But the formula you're using in that expression would probably be helpful!

Not applicable

You could use a combo chart. Make the bars your normal expression, then add an expression such as:

dual('$(=(1-above(sum(Sales))/100)),sum(sales))

Make this new expression a dot, and select show values on data points.

rustyfishbones
Master II
Master II

I have added that above, mark if helpful or correct

mhassinger
Creator
Creator
Author

Thanks, all! It was the Above function that really de-mystified what I was trying to do!

Not applicable

No problem! Good luck