
Distinct count is one of the most commonly needed calculations in data analysis. A distinct count returns the number of unique values in a column. In Excel, users often build complex formulas with UNIQUE, COUNTA, array formulas, or pivot table tricks to get distinct (unique) counts. In Power BI, this is usually a one-click action inside a visual, and you can also create a reusable DAX measure when you want the same distinct count across multiple visuals.
In this tutorial, we will show how to calculate a distinct count in Power BI. With one click, you can see how many unique values exist in a column, ignoring duplicates.
Method 1: Built-In Summarization Setting (1-Click Distinct Count in a Visual)
This is the “bite-sized” transition Excel users love. The quickest way to get a distinct count requires no formulas at all.
Let’s assume you have sales data and want to know, “How many unique customers placed orders?” (instead of counting every order row).
Steps:
- Add a Card visual
- Drag the field you want to count uniquely into the visual:
- Drag Customer ID into the Fields well

- In the visual’s Fields pane, click the drop-down next to that field
- Choose Count (Distinct)

Power BI will display the count of unique customers automatically. The default option counts every row (occurrence), but the distinct count only shows unique customers. This method is perfect for quick, one-off analyses, but it can’t be reused as a standalone measure or referenced in other calculations.
Use the 1-click distinct count when:
- You only need it in one visual
- Card visuals → show a single number
- Tables/Matrices → show a distinct count per group/row
- Charts → show a unique count on an axis, legend, or tooltip
- You want the fastest workflow
- You’re building quickly and iterating
Method 2: Creating a Reusable Distinct Count Measure
If you want to reuse the same distinct count in multiple visuals, create a measure.
Distinct customers measure:
- Open the Table view
- Go to the Table Tools tab >> select New measure
- Insert the following DAX measure
Distinct Customers = DISTINCTCOUNT(SalesData[Customer ID])
DISTINCTCOUNT() is the dedicated DAX function for this purpose. It counts the number of unique values in a column.

- Drag Distinct Customers into the Card visual

If you need to exclude blanks in the count, use DISTINCTCOUNTNOBLANK().
- Go to the Modeling tab >> select New measure
- Insert the following DAX measure
Unique Customers (no blanks) = DISTINCTCOUNTNOBLANK(SalesData[Customer ID])

- Drag Unique Customers (no blanks) into the Card visual

Why measures are better than “1-click” in many cases:
- Work consistently across many visuals
- Are easier to maintain and rename (especially in professional reports)
- Can be extended later (filters, conditions, time intelligence)
Method 3: Using CALCULATE() with DISTINCTCOUNT() for Filtered Counts
Often, you need a distinct count under a specific condition. For example, you might want unique customers who spent more than $3,000, or unique products sold in a particular region.
Distinct count with a filter:
High-Value Customers = CALCULATE( DISTINCTCOUNT(SalesData[Customer ID]), SalesData[Sales Amount] > 3000 )
This formula counts unique customers, but only for rows where the order total exceeds $3,000.

Distinct count for a specific category:
Computers - Customers = CALCULATE( DISTINCTCOUNT(SalesData[Customer ID]), SalesData[Category] = "Computers" )
CALCULATE() is the most powerful tool in DAX for applying custom filters to any expression, including distinct counts.

Quick Comparison: Excel vs Power BI
| Task | Excel (typical approach) | Power BI (modern way) |
| Unique count overall | UNIQUE + COUNTA or Pivot + Distinct Count | Drag field → one-click Distinct Count |
| Unique count per category | Pivot table + change to Distinct Count | Drag category to Rows + field → Distinct Count |
| Reusable in many places | Named range + formula copy or Power Pivot measure | One DAX measure → drag anywhere |
| Dynamic with slicers | Requires refreshing the pivot or complex formulas | Automatic filter context |
The key difference: Power BI distinct count automatically respects your report filters and slicers.
Common Gotchas And How To Fix Them
- Confusing count vs distinct count: Count counts all rows, while Distinct count counts unique values. Don’t use COUNT() in DAX when you actually need DISTINCTCOUNT().
- Distinct count seems too high because of blanks: DISTINCTCOUNT() includes blanks as a distinct value. To exclude blanks, use DISTINCTCOUNTNOBLANK().
- Distinct count is missing in my dropdown: You’re using a measure already. Measures don’t show “Distinct count” as an option.
- Counting unique names gives weird results: Names can vary slightly, such as “Acme Ltd” vs “ACME LTD” vs “Acme Ltd.” Count distinct IDs (best), like Customer ID, or standardize names in Power Query (trim, clean, uppercase).
Conclusion
By using the methods above, you can calculate a distinct count in Power BI. With a single click, Power BI can calculate a distinct count that ignores duplicates automatically. You now have everything you need to answer “how many unique X?” questions in Power BI across any slice, filter, or dimension in your data model. If you’re transitioning from Excel to Power BI, this is one of the most satisfying upgrades: you go from complex formulas to a simple dropdown selection. Try it on your next report: find any ID/name/code column, drag it into a visual, change it to Distinct count, and enjoy the simplicity!
Get FREE Advanced Excel Exercises with Solutions!

