3 Replies Latest reply on Oct 21, 2016 10:14 AM by Santiago Sanchez

# Month on Month Calculation with Values from Table

Hello,

I created a table in a worksheet which is in its basics set up like this:

Effective Month                                   Amount

09                                                            134

09                                                            2895

09                                                            6923

08                                                            1023

08                                                            6735

08                                                            9134

I want to sum up all the amounts with the same Effective month value (so in this case, 134+2895+6923 for September and 1023+6735+9134 for August) and then create a calculated field which gives me the difference in % between the sum amounts of the two months. Is there any way I could do that?

Many thanks

• ###### 1. Re: Month on Month Calculation with Values from Table

Hi Chio,

You can actually see this without creating a calculated field! The workbook attached shows this on the 'MoM - Table Calculation'. You can use a Quick Table Calculation to show the percent difference:

If you'd like to use a calculated field with these 2 months as a base, look at the 'MoM - Calculated Field' sheet in the workbook attached. I've used a few fields to split the problem into pieces:

1. Monthly Amount: Returns the SUM of Amount for each month. This uses and LOD expression.

2. August Value & September Value: These use the calculated field above (1) to return a value for each month.

3. Calculated Field - MoM: Shows the ratio between the monthly fields above (2).

Hope this helps!

1 of 1 people found this helpful
• ###### 2. Re: Month on Month Calculation with Values from Table

Hi Santiago,

Thank you very much for your reply and help! I can't manage to open the workbook you attached because it gives me an loading error... can you try attaching it again?

In the calculated field, can I put in some sort of variable so that it gives me a month on month calculation for any two months I choose? Something like a runtime prompt?

Many thanks!

• ###### 3. Re: Month on Month Calculation with Values from Table

What version of Tableau are you using? The workbook in on v10.

You can use parameters to ask for user input and include them on a calculated field: Parameters

1 of 1 people found this helpful