= SUM(Sales[Amount])
This formula calculates the sum of the Amount column in the Sales table. Let’s break down the syntax:
SUM
: This is a DAX function that calculates the sum of values in a column.
Sales[Amount]
: This is a reference to the Amount column in the Sales table.
Table[Column]
. To reference a table, we simply use the table name.
SUM
: Calculates the sum of values in a column.
AVERAGE
: Calculates the average of values in a column.
COUNT
: Counts the number of rows in a table or column.
MIN
: Returns the smallest value in a column.
MAX
: Returns the largest value in a column.
IF
: Evaluates a logical expression and returns one value if it’s true and another if it’s false.
= IF(Sales[Amount] > 1000, "High", "Low")
This formula evaluates the Amount column in the Sales table. If the amount is greater than 1000, it returns “High”. Otherwise, it returns “Low”.
+
: Adds two values.
-
: Subtracts two values.
*
: Multiplies two values.
/
: Divides two values.
&&
: Performs a logical AND operation.
||
: Performs a logical OR operation.
= IF(OR(Sales[Amount] > 1000, Sales[Quantity] > 10), "High", "Low")
This formula evaluates the Amount and Quantity columns in the Sales table. If either amount is greater than 1000 or quantity is greater than 10, it returns “High”. Otherwise, it returns “Low”.