2 Replies Latest reply on Jan 10, 2019 10:13 AM by Kyle Boyce

# SUM for Target Achieved aggregation

Hello,

I am new to Tableau and I am running into an issue that Im hoping you can help me.  I would like to show the Number of Metrics that Have Achieved their Targets.

I have the following columns; User, Metric, Performed, Denominator, Target (see table below)

UserMetric
PerformedDenominatorTarget
John DoeMetricA11.75
John DoeMetricB11.80
John DoeMetricB01.80

In Tableau I am able to create calculated fields

Rate =  Sum(Performed) / Sum(Denominator)

Metric_Target = Avg(Target)

Based on the following I can create a table where I can see which of my Users Rate as well if they have passed their target

MetricRateMetric Target
MetricA100%75%
MetricB50%80%

I can also create calculated field to flag if the Metric has achieved its target by using the following formula

MetricAchieved = IIF( ((SUM([PERFORMED])/SUM([Denominator]))) >= (AVG([TARGET])),1,0)

What I am having an issue with is that I would like to show as a KPI the number Metric Have Achieved their Target

I was hoping that I could Use the following formula Sum(MetricAchieved) HOWEVER I get the following error

Argument to SUM is already an aggregation function and cannot further be aggregated.

What I am hoping my end result to be is to have a Pie Chart that would 1/2 Metrics Met

Please help if you can.

Thank you

• ###### 1. Re: SUM for Target Achieved aggregation

MetricAchieved is already a SUM measure. Drag MetricAchieved into the viz and tableau will aggregate from there if necessary.

My thoughts were the same.

1. create a boolean calc field that tells me if they've hit the target or not.

2. sum those occurrences.

• ###### 2. Re: SUM for Target Achieved aggregation

you could do:

1. Calc Field: ACTUAL = performed/denominator

2. Calc Field: Hit Target = IF ACTUAL>=Target THEN 1 ELSE 0 END

3. Calc Field: Sum of Hits = SUM(Hit Target)