2 Replies Latest reply on Apr 5, 2018 6:16 AM by Bill Benton

# Beginner - Calculating a ratio using two columns of data

I am a Tableau "newbie" and I have a sheet of data with multiple columns in which I want to divide column A by column B to obtain a ratio e.g. and then format it into a percentage.

I created a calculation (A/B) and when I add the calculation to be a new column all I'm getting is a whole number e.g 247.

Can you help me to determine what I'm doing wrong?

Thank you!

Bill

• ###### 1. Re: Beginner - Calculating a ratio using two columns of data

Hi Bill

Welcome to Tableau and the Forum - the answer will depend on how the data is structured - Are A and B separate dimensions? We usually like to see your TWBX workbook to see the data and what you have done

that said if they are separate dimensions           sum(A)/Sum(B) is the usual approach

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Beginner - Calculating a ratio using two columns of data

Hi Jim and thanks in advance.

Below is a clip of my sheet in which I want to divide the following columns to get a ratio.

16-Losses Paid 2017 1 / 11-Premium 2017 to get a ratio of

e.g.

1,391,737 / 1,041,539 = 1.33 or 133%