COUNTDISTINCT

COUNTDISTINCT(list)

Counts how many different values a column holds across a set of rows, such as how many phases feed into a task. Blanks aren't a value and aren't counted, and text is compared ignoring case, so "Civil" and "civil" count once.

Arguments

ArgumentWhat to give it
listA column read from a set of rows, like Upstream[Phase]. Text, numbers, durations, dates or TRUE/FALSE. An empty list counts 0.

Examples

Formula
=COUNTDISTINCT(Upstream[Phase])

How many different phases have work leading into this task.

Formula
=COUNTDISTINCT(Assignments[Resource])

How many different resources are assigned to the task.

Formula on WBS rows
=COUNTDISTINCT(Tasks[Calendar][Short name])

On a WBS row: how many calendars the tasks in the node use, by id (Tasks[Calendar] alone is their names, and two calendars can share one). More than one is worth a look when the node's float looks odd.

Measure (on the project)
=COUNTDISTINCT(Tasks[Discipline])

As a measure: how many disciplines the schedule covers.

Reach for something else when

You wantUse
How many rows, not how many different valuesCOUNT
The different values themselves, written outTEXTJOIN over the rows you want
The rows that share this row's valueSAME

Common questions

What does "COUNTDISTINCT needs a list, e.g. COUNTDISTINCT(Upstream[Phase])" mean?

COUNTDISTINCT was given a set of rows. Every row in a set is already different, so say which column's values to compare.

The editor refuses this
=COUNTDISTINCT(Upstream)

To count the rows themselves, use COUNT.