Reference card
DAX components
Data Analysis Expressions
Data Analysis Expressions (DAX) in Power BI is a rich and versatile formula language, composed of a collection of functions, operators, and constants that can be used in
formulas to perform advanced calculations and data analysis.
Data types
Data types define the nature and characteristics of data, dictating how data can be used and manipulated in calculations.
Whole number Integer values without functions. Decimal number Real numbers with fractions.
Boolean True or false values. Text Character data strings.
Currency Monetary values. Date Date and time.
Blank Represents an absence of data.
Operators
Operators in DAX are symbols or keywords that are used to create expressions that compare values, perform arithmetic calculations, or work with strings.
Arithmetic operators
Perform mathematical calculations and produce numerical results.
+ Used to add two numbers. / Used to divide one number by another.
- Used to subtract one number from another. ^ Raises one number to the power of another.
* Used for multiplying two numbers.
Comparison operators
Used to compare values resulting in either TRUE or FALSE.
Checks if A � B = Returns TRUE if value A in a column equals a specified value B.
Checks if A �� B == Returns TRUE if value A in a column and a specified B are strictly equal, i.e. only TRUE if the values are equal or if both values are BLANK.
Checks if A � B > Returns TRUE where value A in a column is greater than a specified value B.
Checks if A � B >= Returns TRUE where value A in a column is greater than or equal to a specified value B.
Checks if A � B < Returns TRUE where value A in a column is less than a specified value B.
Checks if A � B <= Returns TRUE where value A in a column is less than or equal to a specified value B.
Checks if A � B <> Returns TRUE where value A in a column is not equal to a specified value B.
String operator
The primary string operator in DAX is the concatenation operator (&), which joins two or more text strings into a single string.
>
Logical operators
Perform boolean logic operations, allowing for condition-based calculations.
Checks if a value exists within a specified list or
Returns TRUE if both conditions are TRUE; otherwise
&& �AND� it returns FALSE. IN table, returning TRUE if a match is found or FALSE
otherwise.
Reverses the logical value of an expression, returning
Returns TRUE if at least one of the expressions is
|| �OR� TRUE; it’s only FALSE if both expressions are FALSE.
NOT TRUE if the expression is FALSE, and vice versa. It is
a unary operator, i.e. it operates on only one operand.
Variables
Variables are used to store the result of an expression as a named value.
Defining a variable involves assigning an expression to a name, which can then be used throughout a DAX formula:
VAR VariableName = Expression.
RETURN Expression_including_variables
Functions
Functions in DAX are predefined formulas that perform calculations using specific values, called arguments, in a particular order to return a result.
Perform calculations on a set of values to produce a
Determine the number of items within a specific
Aggregation single, summarising value; often used for statistical Counting
dataset; useful for quantitative assessment.
analysis.
Direct the execution flow based on conditions, Evaluate expressions and return boolean values;
Control flow allowing for decision-making processes in data Logical exclusively applicable in calculated columns for
calculations. true/false decision-making.
Handle and manipulate strings of text data, enabling Work with date and time data, facilitating operations
Text operations like format alteration, data cleaning, or Temporal like date calculations, conversions, and period
substring extraction. comparisons.
Provide insights about the nature or characteristics Modify the context or subset of data for specific
Information of data, such as data type identification and error Filter analysis; essential for targeted data examination and
detection. result refinement.