6 Replies Latest reply on Oct 29, 2018 5:11 AM by Shinichiro Murakami

# Tableau Calculations

Hello Everyone,

I'm facing a challenges on tableau calculations please see the scenario below:

Data Table:

I need a output like

Where MOM & 3-Month Average are calculations

User should have a filter option to select the Department (Call/Sales) and Mode (Int/Ext).

And user may also select weather they want to see the 3month average or 6month, 9month or any month.

Grant Total not required. Shinichiro Murakami

• ###### 1. Re: Tableau Calculations

I'd be interested to know if you can do this in one table. Personally I don't think it is possible. The only way I've been able to output something that looks exactly like your requirements is by using multiple tables and stitching them together in a dashboard.

Do you have a reason that it has to be a table output? Personally I would use three line graphs to calculate this. It would be:

1. showing the total sales by date with mode on the colour line

2. second graph with the same layout as above but rather than total sales I'd have a moving difference on the previous month

3. The final would be a moving average which I'd get the code using Tableau's default calculations and then add a parameter to allow the user to change the offset that's being considered

It would give you the same analysis, but might unearth further insight into what's driving the change. Ultimately, the best viz to use would depend on the questions the user is trying to answer with this report

• ###### 2. Re: Tableau Calculations

Hi Rob,

I need this in data table its our requirement. However we dont need to show

the grand total.

Even if you could do this in mulptile table and combined all in dashboard

pls let me know

On Fri, Oct 26, 2018, 8:38 PM Rob Palmer <tableaucommunity@tableau.com>

• ###### 3. Re: Tableau Calculations

Hi Sandep,

To do this in one workbook, you need to duplicate data.

final outcome.

steps.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 4. Re: Tableau Calculations

Sandeep,

I have created 3 sheets each for table, MOM, average. You can put them together on dashboard.

Attaching the worksheet.

Thanks,

AB

• ###### 5. Re: Tableau Calculations

Hello Shin,

There are 2 more challenges:

Challenge 1: When I move the parameter values it also change the data in table as well.

Challenge 2: as this data table have two different types of values (% and Int)

For this I have added a one more column "Data Type" and created two calc field

Field1

If ATTR[Data Type]="Int" then [Value Combined] end

Field2

If ATTR[Data Type]="Percentage" then [Value Combined] end

Then I dragged these two fields and removed the value combined. But it's not showing values or all the month and MOM & Avg as well.

Desired Output:

Have attached the updated data model.

Thanks

Sandeep

• ###### 6. Re: Tableau Calculations

See attached.

If this helped, please mark my answer as correct / helped not from inbox, but from original post.

Thanks,

Shin

1 of 1 people found this helpful