Contents
Common DAX Functions
DAX includes many functions for aggregation, logical conditions, counting, and numerical calculations.
Understanding a few common functions provides a strong foundation for writing more advanced formulas.
SUM and AVERAGE
The SUM function adds numeric values in a column.
Total Sales = SUM(Sales[SalesAmount])
The AVERAGE function calculates the average of numeric values.
Average Sales = AVERAGE(Sales[SalesAmount])
These functions are commonly used in cards, charts, and summary tables.
COUNT and DISTINCTCOUNT
The COUNT function counts nonblank values in a supported column.
Order Count = COUNT(Sales[OrderID])
This example counts nonblank OrderID values. If an order appears in multiple transaction rows, the result may count the same order more than once.
To count unique order identifiers, use DISTINCTCOUNT:
Unique Orders = DISTINCTCOUNT(Sales[OrderID])
This is often more appropriate when one order can contain multiple products.
IF
The IF function evaluates a condition and returns one value when the condition is true and another when it is false.
Sales Status =
IF(
[Total Sales] >= 100000,
"Target Achieved",
"Target Not Achieved"
)
This measure compares total sales with a target of ₹100,000. The result depends on the current calculation context.
DIVIDE
The DIVIDE function performs division while allowing you to specify an alternative result when the denominator is zero or blank.
Profit Margin =
DIVIDE(
[Total Profit],
[Total Sales],
0
)
This returns zero when the denominator is zero or blank instead of producing a division-by-zero error.
Format the resulting measure as a percentage when displaying profit margin.
CALCULATE
CALCULATE evaluates an expression under a modified filter context. It is one of the most important functions in DAX.
For example:
Electronics Sales =
CALCULATE(
[Total Sales],
Products[Category] = "Electronics"
)
This measure calculates sales for the Electronics category by applying the specified filter.
The Products table must be correctly related to the Sales table for that filter to propagate as intended.
CALCULATE becomes especially useful when building conditional totals, comparisons, and advanced business metrics.
Power BI Tutorial
Vishalini A








