Distinct count in Excel pivot tables

Share

Facebook
Twitter
LinkedIn

Ever wanted to get distinct count in Excel? You can use Pivot Table to get the answer quickly. Something like this:

distinct count in Excel - pivot table demo

Here is a simple trick to add distinct count to Excel pivot tables quickly.

Let’s say you have data like this:

sample data for distinct count

As you can see, several products are repeated on each day. When you make a pivot table from this data and add product count, Excel counts all products. But we want to see just the distinct count (ie if there is a duplicate product in a day, we want to count it just once). To get distinct count in the pivot table,

These instructions work only in Excel 2016, Office 365 and Excel 2013. 

  1. Insert a pivot table from your data
  2. In the create pivot dialog, enable “Add this data to data model” option.Adding data to model - Excel pivot tables
  3. Once you have the pivot table canvas, add the product (or any other field for which you want to calculate distinct count) to the values area.
  4. Right click on the values, go to “Value field settings”.Distinct count option in Excel Pivot Table value field settings
  5. Summarize the value by “Distinct count”. This is the last option.
  6. All done!

Distinct Count in Excel Pivot Tables – Example Workbook

If you want to practice this or want to see this with an example, here is the workbook.

More Pivot Table Tricks

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

3 Responses to “CP049: Don’t do data dumps!!!”

  1. Oz says:

    Your title got me nervous because I'm all about data dumps, but not for attaching graphics to data dumps. My reason for using data dumps is when someone is trying to do analysis and their starting point is a report that's formatted in a way for a human to read. I instruct them to stop with the report and go get a data dump: just rows and columns and rows and columns.

Leave a Reply