3 Replies Latest reply on Jul 18, 2018 10:22 AM by Nikhil Sahni

# How to show three measures as data points and their moving averages as trend lines in the same view?

I have three calculated measures let's call them Percent X, Percent Y and Percent Z ( All these are percentages). Now, I created a view using "weeks" on my column shelf and "Measure Values" on row shelf, so that it created three trend lines. From the Marks shelf I changed it from line to circle, so that I have small circles representing the data points. Instead of trend line now you have small circles for Percent X, Y and Z. Now, I want to create three trend lines in the same view which would be the moving average of each one of these. So you will have Moving Avg line for Percent X, Moving Avg line for Percent Y and so on. I would really appreciate if I can get any help on this. Somebody created it in Excel but I don't know how to create it in Tableau. I brought "Measure Values"  again next to the one I already have on my row shelf and select the moving average calculated field but then all 6 measures change to moving averages. If any doubts please ask. Below is the desired view.

Regards

Nikhil

• ###### 1. Re: How to show three measures and their moving averages trend line in the same view?

Hi Nikhil,

Do you have an example workbook at all that you could attach?

I imagine you are wanting to use a dual axis to have multiple marks available. You can do this by duplicating your Measure Values on your Rows and right clicking and select dual axis/synchronize axis. You will then have multiple options in your Marks area where you can select the first one to be circles, and the second one to be a moving average with a line.

Andrew

• ###### 2. Re: How to show three measures and their moving averages trend line in the same view?

Andrew please refer to this image

• ###### 3. Re: How to show three measures and their moving averages trend line in the same view?

Yes Andrew that's what I am doing. In your example there is only one measure but in my case I have multiple measures so, I am bringing "Measure Values" two times on the row shelf just like you brought "Avg(percent) but for the second "Measure Values" I double click on it and then deselect the measures that I have in my first "Measure Values" (which are percentages) and select the moving averages for my second Measure Values and then when I click OK I can see six measures but all are moving averages.