DAX Data Types
DAX Data Types
Variant - - - Variant
Decimal
A Decimal number is always stored as a double-precision floating-point value. Do not confuse this
DAX data type with the decimal and numeric data type of Transact-SQL. The corresponding data type
of a DAX decimal number in SQL is Float.
Currency
The Currency data type, also known as Fixed Decimal Number in Power BI, stores a fixed decimal
number. It can represent four decimal points and is internally stored as a 64-bit integer value divided by
10,000. Summing or subtracting Currency data types always ignores decimals beyond the fourth
decimal point, whereas multiplication and division produce a floating-point value, thus increasing the
precision of the result. In general, if we need more accuracy than the four digits provided, we must use a
Decimal data type.
The default format of the Currency data type includes the currency symbol. We can also apply the
currency formatting to Integer and decimal numbers, and we can use a format without the currency
symbol for a Currency data type.
DateTime
DAX stores dates as a DateTime data type. This format uses a floating-point number internally, wherein
the integer corresponds to the number of days since December 30, 1899, and the decimal part identifies
the fraction of the day. Hours, minutes, and seconds are converted to decimal fractions of a day.
DAX Data Types
Boolean
The Boolean data type is used to express logical conditions.
You will also see Boolean data types as numbers where TRUE equals 1 and FALSE equals 0. This
notation sometimes proves useful for sorting purposes because TRUE > FALSE.
String
Every string in DAX is stored as a Unicode string, where each character is stored in 16 bits. By default,
the comparison between strings is not case sensitive, so the two strings “Power BI” and “POWER BI”
are considered equal.
Variant
The Variant data type is used for expressions that might return different data types, depending on the
conditions.
The Variant data type cannot be used as a data type for a column in a regular table. A DAX measure,
and in general, a DAX expression can be Variant.
Binary
The Binary data type is used in the data model to store images or other nonstructured types of
information. It is not available in DAX. It was mainly used by Power View, but it might not be available
in other tools such as Power BI.
DAX Operators
Operator Type Symbol Use Example
Parenthesis () Precedence order and (5 + 2) * 3
grouping of arguments
Arithmetic + Addition 4+2
− Subtraction/negation 5−3
* Multiplication 4*2
/ Division 4/2
Comparison = Equal to [CountryRegion] =“USA”
<> Not equal to [CountryRegion] <>“USA”
> Greater than [Quantity] > 0
>= Greater than or equal to [Quantity] >= 100
< Less than [Quantity] < 0
<= Less than or equal to [Quantity] <= 100
Text & Concatenation of strings “Value is” & [Amount]
Concatenation
DAX Operators
Operator Type Symbol Use Example
Logical && AND condition between [CountryRegion] = “USA”
|| two Boolean &&
IN expressions [Quantity]>0
NOT OR condition between [CountryRegion] = “USA”
two Boolean ||
expressions [Quantity] > 0
Inclusion of an element in [CountryRegion] IN {“USA”,
a list “Canada”}
Boolean negation NOT [Quantity] > 0