# Get the Percentage to a Goal as a Comparison Key Value

Adding a comparison to a key value will let you compare the current number with another and give you the percentage difference between the two. For example, you can see if the current month's sales are over or under the previous month's sales, and by how much. ("We are beating last month by 21%")

If you are working towards a goal, you can set up your comparison value to show the percentage towards that goal. For example, if you are trying to make 100 sales this month and you have 62 so far, that would be 62% towards your goal.

However, if you just selected 62 as the key value and 100 as the comparison, it would show -38% as the comparison, which isn't as helpful in this scenario. So we need to calculate a specific number to use as the comparison value.

To get that number, the basic calculation would be:

Current_total / ((Current_total / Goal) +1)

In the following examples, our MTD sales is $65,664 and the goal is $100,000. So the comparison value should be 66%.

To prepare the data, I filtered and grouped the data to get the MTD sales and then used SQL to get the goal comparison number:

Here's the SQL used:

SELECT *,

"Sum of MRR"/(("Sum of MRR"/100000)+1) AS "Goal Comparison"

FROM report

You could also use Calculated Columns Transform to get the same number:

{Sum of MRR}/(({Sum of MRR}/100000)+1)

With both examples, if you have the goal number in your data you could reference that column as well.

Please sign in to leave a comment.

## Comments

0 comments