5 Replies Latest reply on Feb 11, 2015 8:10 PM by Tableau kumar

# Row level calculation

Hello everyone. I am mining data for the agency I work for and ran into an issue. I have got the data I need on 2 rows. I need to perform a simple calculation based on the values in the two rows. I need to sum the two values. Once I have the sum, I need to divide one of the numbers by the sum to get a percentage of accuracy. Example, Row 1 has a value of 514/ Row 2 has a value of 409. When I sum, these, I get 923. Now I need to take row 2 value 409 and divide it by the sum 923 so 409/923 to get a value of .4431 or 44.31%.

The problem is, I do not know how to access the numbers from the rows, or the calculation language in Tableau language to achieve the results I am looking for.

I created set 1 (row 1) and set 2 (row 2) and tried to sum them but got errors. I think it is pulling the names of the rows not the numbers. I have attached a screenshot to try and help explain. Any help would be greatly appreciated.

Mike

• ###### 1. Re: Row level calculation

You don't really need a calculated field for this. On your workbook, click on the analysis tab > total > and turn on grand totals for columns. This will add a grand total row at the end of the table. Then you can go back to analysis click percent of table. This will give you the row contribution to the total value in percentages. Let me know if you have questions.

PS: I don't have access to tableau right now so the path I used above might not exactly match.

• ###### 2. Re: Row level calculation

Once again Pooja,

Thank you for your response, it was helpful and met my need.

Mike

• ###### 3. Re: Row level calculation

Hi Mike,

I am glad I could help. On a side note, please mark the answer correct by 'hitting the green star' on the response.

• ###### 4. Re: Row level calculation

Is there a way with the below data to show on the dashboard 7%  (got this from dividing row 2 into row 1 (1,429/20,301).  I want to show on the dashboard just this percentage with a header "Percent Unique Cards Suspended"   Thanks you, Rob

• ###### 5. Re: Row level calculation

Hi,

We can do Table Calculation, ( I am treating you are having only 2 values "Category" Field.)

I have added Dimension  & Measure on the first report.

2) I have created another report as same as above in the first step. Then i have added table Calculation like below image.