cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an average line in a bar chart?

lalasisi
9 - Travel Pro
9 - Travel Pro

I'm trying to create a dynamic average line in a bar chart on Sisense (orange line).

lalasisi_1-1724894998528.png

My sample data looks like the below. Is there a way for Sisense to calculate the average of all teams by default (i.e. $305K) and then display the orange line on the bar chart? In addition, if the user only filters to 2 teams e.g. Boston Red Sox and New York Yankees, the average would be changed to $135K and the line would automatically changed to $135K?

lalasisi_2-1724895019185.png

Attached is my sample data and chart in excel

2 ACCEPTED SOLUTIONS

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @lalasisi ,


You can add aggregation by teams like in the formula: 

AVG([Condition],sum([Quantity]))

Just take you base formula (sum([Quantity]) - in my case) and put it inside AVG([Condition],formula). 
And replace [Condition] with the column with teams.

Angelina_QBeeQ_0-1724928648935.png

More about aggregation you can find here: https://docs.sisense.com/main/SisenseLinux/build-formulas.htm

Always here to help,
Angelina from QBeeQ
[email protected]
QBeeQ - Gold Implementation and Development Partner

 

View solution in original post

Thanks for your reply! It's in the right direction but the formula you shown isn't correct. I followed the documentation to create the correct formula and it worked now. 

View solution in original post

4 REPLIES 4

Helena_qbeeq
9 - Travel Pro
9 - Travel Pro

Hi @lalasisi ,

You can achieve this by creating a line chart, adding an additional measure that will calculate the average, and changing the chart type for the Cost to column.

Helena_qbeeq_2-1724928912016.png

Here is the formula to get the average:

Helena_qbeeq_1-1724928891574.png

And the final result:

Helena_qbeeq_0-1724928854934.png

Please let me know if this works for you : )

Always here to help,
Helena from QBeeQ
[email protected]
QBeeQ - Gold Implementation and Development Partner

 

Thanks for your reply! It's in the right direction but the formula you shown isn't correct. I followed the documentation to create the correct formula and it worked now. https://docs.sisense.com/main/SisenseLinux/build-formulas.htm

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @lalasisi ,


You can add aggregation by teams like in the formula: 

AVG([Condition],sum([Quantity]))

Just take you base formula (sum([Quantity]) - in my case) and put it inside AVG([Condition],formula). 
And replace [Condition] with the column with teams.

Angelina_QBeeQ_0-1724928648935.png

More about aggregation you can find here: https://docs.sisense.com/main/SisenseLinux/build-formulas.htm

Always here to help,
Angelina from QBeeQ
[email protected]
QBeeQ - Gold Implementation and Development Partner

 

Thanks for your reply! It's in the right direction but the formula you shown isn't correct. I followed the documentation to create the correct formula and it worked now.