6 Replies Latest reply on Sep 22, 2014 7:29 AM by Toan Hoang

# Count distinct as a percentage of total - across: inaccurate percentages displayed

I'm working with a data set that has multiple lines for each Call ID which is a unique number. To eliminate duplicate records for each Call ID, I'm utilizing COUNTD.

The issue that I'm unable to resolve is that when I convert this distinct count to a "percentage of total" and then edit the calculation to reflect across the table, the values add up to more than a 100%.

Not sure what tableau is doing over here. Any suggestions?

Thanks,

Josiah

• ###### 1. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

I believe you are using the wrong field for this. . . when you convert from COUNTD to Percentage of Total, it is bringing back the dupes. I think you should be using the percentage of total on a measure and not the Dimension.

I'm not exactly sure what you are trying to do, and it is difficult without seeing some data (made up is fine) or even a screenshot. You could also try making a calculated field that is already COUNTD(Call ID) and then doing percentage of total on that, but I think it is more likely the first issue.

So really you'd have

COUNTD(Call ID), Percentage of Total(# of Calls), Percentage of Total(# of Minutes)

but I'm just speculating based on what you said.

• ###### 2. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

"You could also try making a calculated field that is already COUNTD(Call ID) and then doing percentage of total on that, but I think it is more likely the first issue."

This is exactly what I'm doing, and it is a measure NOT a dimension. It is after I bring it out onto the worksheet that I do the percentage of total on it.

I'll look at uploading some sample data in a bit to help.

Thanks Jordan,

Josiah

• ###### 3. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

Wouldn't the percentage of total in this instance just be equal for all COUNTD(Call ID)? Is that what you are trying to get?

It could be that for whatever reason it is converting it to a number and dividing it by the COUNT of items, which would lead to the > 100% issue.

• ###### 4. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

Jordan,

I think you might have hit the nail on the head so to speak. I'll try and upload a small sample .twbx

Thanks,

• ###### 5. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

Hi there,
I'm having the exact same issue and have tried just about everything I can think of to solve this. Any progress?
Edit: whoops I didn't realize this was from 4 years ago, but question still stands...

• ###### 6. Re: Count distinct as a percentage of total - across: inaccurate percentages displayed

I have having the same problem. My solution was to put the distinct count in the SQl as opposed to using tableaus COUNTD.