3 Replies Latest reply on Aug 19, 2016 10:30 AM by Christopher McKinnish

# Create Calculation based on Totals

Simple setup.   Note:  This is not excel.

Each row for expense and revenue is a measure, not calculated.  The O/R column is a simple calculation [Expense/Revenue]

Now I have Totals Setup.  Of course the Total Row for Expense and Revenue is perfect, and of course the OR total row is not.

What is should be is the Total Expense divided by the Total Revenue.

Does anyone know how I can do this in this single view?

• ###### 1. Re: Create Calculation based on Totals

There is a total using pick if you rick click the pill, but from your statement the OR is Column A divided by Column B - does not follow from the values that I see.

• ###### 2. Re: Create Calculation based on Totals

Hello,

I'm guessing you need to apply aggregations -- try SUM(Expenses) / SUM(Revenue) -- without the aggregation, you will see incorrect results in the view:

Here's a video explaining the concept: Aggregation, Granularity, and Ratio Calculations | Tableau Software

If this does not help, please consider posting a sample Packaged Workbook (.twbx) along with what version of Desktop you are using, so others can see the data and apply help.  Its difficult to help without having a workbook, and nearly any scenario can be mocked up since we can simply copy and paste data out of, and into, Tableau Desktop.

Best of luck!

1 of 1 people found this helpful
• ###### 3. Re: Create Calculation based on Totals

Thank you - This is what I did.  I realized this after I stepped away.  I got lost in the forest because of all the tree's.  Thank you!!