6 Replies Latest reply on Oct 21, 2018 8:15 PM by Shinichiro Murakami

# How to calculate rolling month for last 12 months?

Hi Tableaurs,

I want to show last 12 months rolling value in the bar chart form. For instance : If i click the month of April 2018 in the bar chart

it should give me the output of total value from May 2017 to April 2018 ,. It should show the total sum of sales from May 2017 to April 2018 divided by distinct customer_id for this period only.

Likewise , if i click month of May 2018 in the bar chart it should show the total value from June 2017 to May 2018.  it should show the total sum of sales from June 2017 to May 2018 divided by distinct customer_id for this period

and so on until the data available..

Logic should be like this : SUM(Sales) / Unique (Customer_Id)

Attached is the sample workbook for your reference. Kindly help. thankyou

• ###### 1. Re: How to calculate rolling month for last 12 months?

Formula seems messy, but this is still the simplest.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: How to calculate rolling month for last 12 months?

Schinchiro Murakami san,

Thank-you very much for your reply. Its working using sample data i have provided. I have two questions :

1.May i know, can we restrict the data to current month only ? could you help how to manipulate the calculation, if i want to see the data until current month only. I have attached the sample workbook the data has until Jan 2019. But i want to see until this month only.

For example, i have data for June 2016 to Jan 2019. But i want the output to show until current month only (Until October 2018). When november starts , it should populate until november month only.

So as the month goes, the data will dynamically populate for the respective months. Shinichiro Murakami

2. Apart from this, Can the person select N month , for example. need to provide start month and end month . If i click start month and end then month it should populate only between these two and show the values you did above . i.e Sum of sales / Countd (customer_id) for that period

Can provide solution using two workbooks for my understanding.

your help is much appreciated. thankyou

• ###### 3. Re: How to calculate rolling month for last 12 months?

any suggestion?

• ###### 4. Re: How to calculate rolling month for last 12 months?

Q2, I don't quite understand your needs.

It seems very different from original.

I want you to close this thread with marking my answer as correct (not from inbox but from original post),

and create new post with clarifying your request one more time.

Thanks,

Shin

• ###### 5. Re: How to calculate rolling month for last 12 months?

Schinchiro Murakami san,

Thankyou. Marked this post as correct Shinichiro Murakami

• ###### 6. Re: How to calculate rolling month for last 12 months?

You are very welcome.

Shin