5 Replies Latest reply on May 26, 2017 4:21 AM by Corey Blevins

# How to calculate the percentage of a subset of my data

I have a set of data that includes the status of 200+ tasks, including: Not Started, In Progress, Deferred, Not Required, Completed etc.

I have converted the status for each task to a matrix of 0 and 1.

I want to calculate the % of Completed tasks, but it isn't based upon the total task list, it is based upon the subset of tasks that have a status that isn't "Not Required".

To do this, I created fields for each task, such as sum([Completed]).

I am trying to achieve essentially this: sum([Completed])/(sum([Completed])+sum([Not Started])+sum([Deferred])+sum([In Progress]))

This does not work.

This did work, however, it gives a different result based upon the sheet I am using, which is confusing the heck out of me.

[c.completed count]/[number of records3]*100

where

number of records3 = countd([Task Name])

this is the percent1 attachment

the percent 2 attachment (look in the tooltip) shows what happens when I try to use this measure on my main sheet.

I have attached an excel sheet with my binary matrix if that will help. I cannot provide the columns that show the unique task names, as they are proprietary.

• ###### 1. Re: How to calculate the percentage of a subset of my data

Hi Corey,

I checked your dataset . In the dataset there is not ID which completed.  So not able to achieve what your are trying.

Please provide a proper dataset. Upfront thanks a TON

Regards,

Norbert

• ###### 2. Re: How to calculate the percentage of a subset of my data

That’s what I get for only exporting the first 10,000 rows. Here is a filtered set. Sorry about that.

Corey

• ###### 3. Re: How to calculate the percentage of a subset of my data

I figured this out. Fortunately, we had a Tableau users meeting today, and there were two employees there. I used a {fixed : number of records3 } to force my denominator to stop filtering based upon my color marks and include the whole bar.

Corey

1 of 1 people found this helpful
• ###### 4. Re: How to calculate the percentage of a subset of my data

Corey,

Regards,

Norbert

• ###### 5. Re: How to calculate the percentage of a subset of my data

I simply cannot find where I mark the question as answered. Can you attach a screenshot of where the button is?

I feel silly!