4 Replies Latest reply on Jun 30, 2017 12:25 AM by Nayana Bhagat

How to plot a line chart one for overall avg and other for current month on single chart

Hi,

What I want is to plot a line chart on same measure and same dimension but one for the overall average and other for the current month average
My Dimension is Department and my measure is Ratings.

I am able to plot this individually on separate charts but not on one.

What I want is something like in the below image.
using tableau 10.1

Any help would be much appreciated.

Thanks,
Nayana

• 1. Re: How to plot a line chart one for overall avg and other for current month on single chart

Hi Nayana, it would be good if you could post a workbook, but in the meanwhile, here's a comparable example using average sales by region over 4 years vs average sales by region for the most recent year (2016).

A calculated field to isolate 2016 Sales could look something like:

2016 Sales: If YEAR([Order Date]) = 2016 THEN [Sales] END

Note that i converted by measure types from Sum to Avg on the Rows shelf. Workbook attached.

-- Glenn

1 of 1 people found this helpful
• 2. Re: How to plot a line chart one for overall avg and other for current month on single chart

Hi Nayana,

You can use a LOD expression for this.

From the sample super store data if we want to plot the yearly sales for Segment again the avaerage sales of the segment for the year the following would be the calculation :

{FIXED [Order Date]: AVG([Sales])}

Bring the Segment and Order date to the Columns. Place segment on colors mark.

Sales and Average Sales ( LOD Calculation ) to the rows, select dual axes:

Here is what your screen should look like this :

Do let me know if it helps.

Thanks

Rahul Singh

• 3. Re: How to plot a line chart one for overall avg and other for current month on single chart

Thank you Glenn, this helped alot

Cheers!

Nayana

• 4. Re: How to plot a line chart one for overall avg and other for current month on single chart

HI Rahul,