Pritesh Gujarati
Pritesh Gujarati

Reputation: 49

How to add two separate Average line in Tableau

I Have a salary graph. I have added marital status in details so I have married and single Line graph. now I want to add Average line for both. Currently I have a Average line but it is average of salaries. I want two separate average line for each married salary and single salary.

Thanks for help.

Upvotes: 0

Views: 371

Answers (1)

Fabio Fantoni
Fabio Fantoni

Reputation: 3167

Assuming your line chart has one point per year, you just need to create a calculated field using LOD in order to calculate the avarages like this one:

{ EXCLUDE [year of salary] : AVG ({ FIXED [Marital Status],[year of salary]: SUM([Salary])})}

With a dual axis line chart, you can get something like this: enter image description here

Upvotes: 1

Related Questions