DAX Aggregations Functions
Computing totals, averages, counts, or identifying the minimum or maximum value in DAX
What Are Aggregation Functions in DAX?
Aggregation functions in DAX are used to summarize or aggregate data values such as computing totals, averages, counts, or identifying the minimum or maximum values.
They are core tools when building measures and visuals in DAX-based reports.
Common Aggregation Functions in DAX
Function | Description | Example |
---|---|---|
SUM() | Adds up all numeric values in a column | SUM(Sales[Revenue]) |
AVERAGE() | Returns the average (mean) of a column | AVERAGE(Sales[Discount]) |
MIN() | Returns the smallest value in a column | MIN(Orders[Quantity]) |
MAX() | Returns the largest value in a column | MAX(Orders[Price]) |
COUNT() | Counts non-blank values in a column | COUNT(Customers[Email]) |
COUNTA() | Counts all non-blank values (any data type) | COUNTA(Orders[OrderID]) |
COUNTBLANK() | Counts the number of blank values in a column | COUNTBLANK(Orders[ShippedDate]) |
DISTINCTCOUNT() | Counts the number of unique values in a column | DISTINCTCOUNT(Sales[CustomerID]) |
Key Points
- Aggregation functions typically operate on columns.
- They are mostly used in measures, but can also be used in calculated columns (less common).
- Filter context impacts the result of aggregation functions especially in visuals or when using
CALCULATE()
.
Example
- Measure using
SUM()
:
Total Sales = SUM(Sales[Amount])
This will return total sales amount depending on the filter context (e.g. by year, region, etc.).
Nested Aggregations with CALCULATE()
You can modify aggregation results using CALCULATE()
:
Total Sales 2025 = CALCULATE(SUM(Sales[Amount]), Sales[Year] = 2025)
No questions available.