Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

One linear trendline on stacked bar chart

How do i insert ONE linear trendline on a stacked bar chart? The default functionality is for multiple trendlines to be shown, which reflect each value of the dimension. I just want one for the total

I'm guessing i need to use a reference line, but can't figure our how to make it work.

The expression for my bar chart is very simple

=SUM(Revenue/1000)

and the primary dimension is calendar week.

So do I need to do some sort of week count in the reference line expression?

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

I found the answer elsewhere. Thanks for your help though.

You can try to create an expression, unchecking 'Bar' and checking 'Values on data', in this expression is where you have to check the linear trendline.

The expression should be something like:

Sum(TOTAL <Week> Revenue/1000)

View solution in original post

6 Replies
ecolomer
Master II
Master II

You can use graphic mixed bars & lines,  and select for each expresion if your representation is bar or line

p05.png

p06.png

Not applicable
Author

This does not work, because the secondary dimension I have affects the chart. As you cannot have a line on a combo chart and retain the stacked appearance of the bars. It always reverts to Grouped

Not applicable
Author

Sorry. I meant tertiary dimension

This is how my chart currently looksbars.png

ecolomer
Master II
Master II

And, you want a line for the total?

Can you upload the file qv?

I think the same possibility las entry post

Not applicable
Author

The information is sensitive so I can't really upload it unfortunately.

The line i need is as if I removed my tertiary demension. In the example below, i have removed my tertiary dimension and simply ticked 'Linear' on the trendlines. This is exactly what I need, except that I need to retain the tertiary demension and the stacked appearance of the bar chart.

linear trendline.png

This is what happens when I retain the dimension

multiple trendlines.png

As you can see, a trendline for each value appears! I only want one, for the total trend.

Not applicable
Author

I found the answer elsewhere. Thanks for your help though.

You can try to create an expression, unchecking 'Bar' and checking 'Values on data', in this expression is where you have to check the linear trendline.

The expression should be something like:

Sum(TOTAL <Week> Revenue/1000)