100% Stacked bar/area chart

I’m trying to achieve a 100% stacked bar (or area) chart.

Below is what I have so far vs what I want to achieve (quick sketch).


The purpose is to get a better visual representation of how the bars have changed over time.

You could say the Pie chart achieves what I want (percentages of a whole) but I cannot get the visual comparison side by side. With multiple pies you can get the comparison over time but not as cleanly as this.

Any ideas on how to achieve 100% stacked bar chart?

Would a formula work that normalizes the amounts to percent of total, either at the database or the report level?
Percent of Color = ColorValue/SUM(ColorValues) for each quarter?

1 Like

That was actually my first idea but I kept getting division by zero errors so I stopped trying after a while :slight_smile:

I first tried getting the ratio by doing this, but same error, division by zero.
Any ideas where I’m going wrong?

ABS(
	SUM([Amount])
) / RUNNING_MAX(
	ABS(
		SUM([Amount])
	)
)

I’ll try to look at doing it your way as well by normalizing each bar instead of trying to normalize for the maximum of the bars.

Some progress:

I can get it normalized if I only have it active on one quarter/bar.

But if I add more it falls apart :smiley:

And it’s not really strange since it’s calculating with the total of all bars. So it’s correct across all bars (they add up to 1) but not on each individual bar (which is what I want).

I’m looking for a way to divide by the total of each bar, not all bars.

If anyone can see anything obvious I’m missing, please let me know, it would be much appreciated! :pray:

Would you be willing to share the relevant space (as a template) and we might be able to help you.
If you don’t want to share publicly, ping us in the chat, and you can provide it to us in a dm

Thanks for the offer @Chr1sG!

I went ahead and created a test space demonstrating the problem I have.

I think the only way to solve this is to make a couple of helper fields in the financial rows database, which allows each entry to ‘know’ the total value of all entries in that month.
Then you can just divide by this amount in the reports.

2 Likes

Alright, thanks for checking!