# Count & CountD functions in Tableau

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-02-11
- **Format:** Video · 5 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, count, countd)
- **Canonical:** https://just-tim.com/posts/count-countd-functions-in-tableau
- **Watch:** https://youtu.be/M2lZi2IBEPQ

I walk through Tableau's COUNT and COUNTD (count distinct) functions using the Superstore sales data. I show how COUNT tallies every instance of an item while COUNTD counts only unique values, and explain practical uses including data quality checks.

## Key takeaways

- COUNT returns the number of items in a group and ignores null values, effectively acting as a row count when applied to a field
- COUNTD (count distinct) counts each unique value only once, so counting subcategory within a single subcategory grouping returns one
- COUNTD is useful for guarding calculations so they only fire when you are at the lowest, single-item level of a grouping
- Because count ignores nulls, comparing a count against your dataset's row total gives a quick data quality check

## Chapters

- 0:10 Building the base view
- 0:43 Using the COUNT function
- 2:36 Using COUNTD (count distinct)
- 3:16 Practical use cases and data quality

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/count-countd-functions-in-tableau

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
