1 of 1 people found this helpful
Have you tried writing a calculated field, like:
COUNTD(IF sum([Sales])>=10,000 then [CustomerName] END)
(give me a count of unique customer names that have sales greater than or equal to 10,000)
If you place "Region" on the Rows shelf, and this calculation on the Rows or Text shelf, you should get the results you are looking for
I got a couple of errors from your calculation, but I was able to follow your logic. Tableau doesn't recognize the COUNTD function, I got an error about mixing aggregate and non-aggregate comparisons, and the IF needed an END keyword. I changed the calculated field to the following, and it worked.
COUNT(IF [Sales] >= 10000 THEN [CustomerName] END)
Thanks for your help.
Yes, if you are using an Excel data source, you must Extract your data in order to use the count distinct (COUNTD) function. This is important to note, because COUNT will include duplicates, while COUNTD will return the unique count. So, if what you need is Count Distinct, you'll need to extract your data. Also, you are correct, any IF condition will need an END to be valid in Tableau.
Thanks. That did it.
Not a problem at all, glad its working.