9 Replies Latest reply on May 15, 2018 12:38 PM by Deepak Rai

# Calculating a Dimension's Percent of Total based on the Dimension's value

Hi. I am a novice to Tableau and am sure there is probably a fairly simple way to do this but I keep going into a mental loop when trying to figure it out :-)

• I have a Dimension called "Complexity". Possible values are "High" or "Low".
• I have a graph that shows the number of projects per client, by complexity (High or Low).
• I want to calculate the % of High complexity projects against the total number of projects .

For example, I have 150 High Complexity projects out of a total of 210 (71%) but can't figure out the formula for this.

I have attached a workbook that has a red tab called "Complexity" that I want to perform the calculation on.

Thanks

• ###### 1. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

Hi Richard,

Here it is, I am showing at each point in your graph and you can see the Grand Total Showing 71.43%. Don't forget to add Filters to CONTEXT.

Thanks

Deepak

If it Helps, Pl mark it Helpful and CORRECT TO close Thread • ###### 2. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

Thanks. The formula is what I am looking for but I don't want the percent per client, just the overall % of High complexity projects overall. I don't want to show the % in the graph, probably will use in an Annotation or as a separate text table to include on the dashboard.

Suggestions on how to simply calculate the % and then use it in an Annotation?

Thanks

• ###### 4. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

Thanks. I am unable to get the calculated field to appear in an Annotation so it overlays the graph. I tried adding the calculated field to the Details but it still does not appear in the list of attributes available to include in the annotation. Suggestions?

• ###### 6. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

That doesn't add it to the list for the Annotation. I am also getting an incorrect result when I use the formula you provided, although I cannot figure out why. Instead of getting 76% as the result when I apply it to my data I get .19%. Very strange

• ###### 7. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

You need to add filters to CONTEXT. Check my workbook. All filters are in CONTEXT. Right click on any Filter  and then select add to context.

• ###### 8. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

Thanks very much for the help and your patience. It is appreciated.

Adding the filters to the Context resolved that issue, thanks. I am still unable to see the Calculated Field in the list of available attributes when I Annotate the graph. It does appear when I annotate a Mark but the percentage shown is for the Mark and not the overall %. Any idea how I Can get the calculated Field to appear in an Annotation or how to overlay the result on the graph?

• ###### 9. Re: Calculating a Dimension's Percent of Total based on the Dimension's value

I think you can Create two Sheets and then put them Side by side in Dashboard. I am running short of Ideas on This. If you think., That the Calculation I provided worked , then Please Take a sec to Close Thread by marking my Reply as Helpful and CORRECT. The CORRECT button is  under my Reply in your this thread, not in email.

Thanks

Deepak