Average value (annotation line) in stacked-bar chart

Hi! How do I output the average value (line)?

The average should be something like this:

AVG([Expenses]) doesn’t work the way I want.

The X-axis is Date.

Thank you very much!

Maybe there’s an example or something similar?

The colour coding seems to show that there are actually a lot of small values (stacked on top of each other) so I suppose that the average is correctly calculated for these values, as separated into categories.
Can you check the behaviour with the colour grouping turned off.

1 Like

Thank you for the reply! Unfortunately, nothing has changed

It still looks like the bars are segmented. What is the configuration of the y-axis?

@Chr1sG

So it looks like you are plotting the value of Cymma for each entity, but then stacking them where they share the same Date (based on the date grouping of the x-axis). So the average will be the average value of Cymma for all entities, not the average value of the sum of Cymma for each date period.

What does it look like if you set the y-aggregation to ‘Sum’ and then set the Annotation line as AVG(SUM([Cymma]))
?

1 Like

@Chr1sG

I think that’s what I need - solution:

but the chart type is not stacked-bar, unfortunately

Out of curiosity, what happens if you add the colouring by category back in?

@Chr1sG

sadly:

Yeah, kinda what I expected, Just wanted to check.
Does the y-axis config allow you to define the annotation line as AVG(SUM([Cymma])) ?

Also, what does it look like if you choose side-by-side bars instead of stacked?

No: Cannot use aggregation inside aggregation

I can’t find that option…

Like this?

Yeah, I feared that would be the case :frowning:

Yeah, that’s what I meant. I can see it’s rather ugly though. Might look better with fewer x-axis groups, but I’m afraid the choices you have seem to be either side-by-side, or no categorisation.

1 Like