06.1Aggregators
You already know SUM, AVERAGE and DISTINCTCOUNT. All three take a whole column and draw a single value from it, a total, an average or a count. They are called aggregators.
06.1.1One column, a single value
In Excel, =SUM(C2:C13) takes a range of 12 rows and returns a single number. So does =AVERAGE(C2:C13). A range goes in, a number comes out.
In DAX, the principle is the same, with a column in place of the range:
The Sales[Qty] column has 12 values, 10, 3, 4, 10, 6, 8, 3, 15, 6, 3, 2 and 5. SUM adds them up, and returns a single value, 75.
A function that takes a whole column and reduces it to a single value is called an .
Where does the word “aggregator” come from?
The word comes from the Latin “aggregare,” made of “ad,” “toward,” and “grex,” the flock. Its first meaning is “to gather into a flock,” that is, to bring together.
English took the word from that Latin root. To aggregate means to gather separate parts into a single whole, and an aggregate is the whole you get.
The noun aggregator is much more recent. In everyday language, it mostly names a website or an app that gathers content from many sources in one place.
DAX keeps the original idea. An aggregator gathers all the values of a column, the way you round up a flock, and keeps only a single value from them, a total, an average or a count.
06.1.2Common aggregators
Each aggregator reduces the column in its own way. Here are the most common ones, with their equivalent in Excel:
- SUM( Sales[Qty] ) adds up the values, like SUM. It returns 75.
- AVERAGE( Sales[Price] ) takes the average, like AVERAGE. It returns 29,583.33.
- MIN( Sales[Price] ) keeps the smallest value, like MIN. It returns 10,000.
- MAX( Sales[Amount] ) keeps the largest, like MAX. It returns 250,000.
- COUNT( Sales[Qty] ) counts the values, like COUNT. It returns 12.
- DISTINCTCOUNT( Sales[Customer ID] ) counts the different values. It returns 7, since 7 customers made a purchase.
COUNTROWS, seen earlier, counts the rows of a table. COUNT counts the values of a column.
Practice
Each exercise is solved with one of the functions shown here, on data other than the course data. Pick the right formula out of five.
Direct useMeasureDifficulty
A bakery records each day the number of baguettes baked, in the “Batches” table. Write the “Baguettes Baked” measure, the total of the “Baguettes” column.
Batches Day Baguettes 3/2/2026 120 3/3/2026 95 3/4/2026 140 Which formula should you write for “Baguettes Baked”?
Direct useMeasureDifficulty
A teacher records the grades of an exam in the “Exams” table. Write the “Average Grade” measure.
Exams Student Grade Lou 12 Max 15 Nina 9 Omar 16 Direct useMeasureDifficulty
A library gives the publication year of each book in the “Books” table. Write the “Earliest Publication” measure.
Books Title Year Germinal 1885 Emma 1815 Dune 1965 Direct useMeasureDifficulty
An athletics club records in the “Jumps” table the length of each jump, in meters. Write the “Best Jump” measure.
Jumps Athlete Meters Léo 6.8 Maya 7.2 Sami 6.5 Direct useMeasureDifficulty
A hotel asks each traveler, on departure, for a rating out of 5, stored in the “Reviews” table. The rating stays blank when the traveler did not answer. Write the “Reviews Received” measure, the number of ratings in the “Rating” column.
Reviews Room Rating 101 4 102 103 5 104 3 Direct useMeasureDifficulty
A carrier records in the “Routes” table the city of each parcel delivered. Write the “Cities Served” measure, the number of different cities.
Routes Parcel City C-201 Lyon C-202 Nantes C-203 Lyon C-204 Lille
06.1.3A column, and nothing else
An aggregator takes a column, as it is in the table. You cannot give it a calculation.
Power BI rejects this formula.
SUM expects a column, and Sales[Qty] * Sales[Price] is not one. It is a calculation that would have to be run on each row before adding up. For that, DAX offers another family of functions, presented later.
Quiz
The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.
Question 1
Without any filter, what does the measure DISTINCTCOUNT( Sales[Price] ) return?
Question 2
Which of these measures does Power BI accept?
Question 3
The 12 sales bring in 1,700,000 for 75 cars. You want the average price of a car sold. Which measure should you write?
- An aggregator takes a whole column and reduces it to a single value.
- SUM, AVERAGE, MIN, MAX, COUNT and DISTINCTCOUNT are aggregators.
- An aggregator takes a column as it is. You cannot give it a calculation.