This is the second part of the DAX Functions series. You can also visit our other articles in the same series. i.e.

DAX financial functions


CURRENCY function in DAX

Converts a number to a currency value using a specified locale.

Syntax

C#
CURRENCY(number, decimal_places, locale)

Example

C#
CURRENCY([Sales Amount], 2, "en-US")

Converts Sales Amount to US dollar currency with 2 decimal places.

FIXED function in DAX

Rounds a number to a specified number of decimals.

Syntax

C#
FIXED(number, decimals)

Example

C#
FIXED([Cost], 2)

Rounds Cost to 2 decimal places.

INT

Rounds a number down to the nearest integer.

Syntax

C#
INT(number)

Example

C#
INT(SUM([Units Sold]))

Rounds down total units sold to nearest whole number.

ROUND function in DAX

Rounds a number to the nearest integer or specified number of decimals.

Syntax

C#
ROUND(number, decimals)

Example

C#
ROUND([Revenue], 0)

Rounds Revenue to the nearest whole number.

ROUNDUP - Rounds a number up to the nearest integer or specified number of decimals.

Syntax

C#
ROUNDUP(number, decimals)

Example

C#
ROUNDUP([Cost], 1)

Rounds Cost up to 1 decimal place.

DAX Information Functions


ISBLANK function in DAX

Checks if a value is blank. Returns TRUE or FALSE.

Syntax

C#
ISBLANK(value)

Example

C#
IF(ISBLANK(Sales[Region]), "No Region", Sales[Region])

Returns "No Region" if Region is blank in the Sales table.

ISERROR function in DAX

Check if a value or expression results in an error. Returns TRUE or FALSE.

Syntax

C#
ISERROR(value)

Example

C#
IF(ISERROR(1/0), "Error", 1/0)

Returns "Error" since 1/0 results in a divide by zero error.

ISEVEN Function in DAX

Check if a number is even. Returns TRUE or FALSE.

Syntax

C#
ISEVEN(value)

Example

C#
ISEVEN(Sales[CustomerID])

Returns TRUE if CustomerID is an even number in the Sales table.

ISODD function in DAX

Check if a number is odd. Returns TRUE or FALSE.

Syntax

C#
ISODD(value)

Example

C#
ISODD(Sales[Units Sold])

Returns TRUE if Units Sold is odd for a row in the Sales table.

USERNAME function in DAX

Returns current username.

Syntax

C#
USERNAME()

Example

C#
"Report generated by " & USERNAME()

Returns current username that can be used in visuals.

DAX Logical functions


AND function in DAX

Performs a logical conjunction on two or more conditions. Returns TRUE if all conditions are true.

Syntax

C#
AND(logical1, logical2, ...)

Example

C#
AND(Sales[Units] > 100, Sales[Country] = "USA")

Returns TRUE if Units are greater than 100 and the Country is the USA.

OR function in DAX

Performs a logical disjunction on two or more conditions. Returns TRUE if any condition is true.

Syntax

C#
OR(logical1, logical2, ...)

Example

C#
OR(Sales[Units] > 100, Sales[Country] = "France")

Returns TRUE if Units are greater than 100 or the Country is France.

NOT function in DAX

Logically negates a condition. Returns inverted TRUE/FALSE value.

Syntax

C#
NOT(logical)

Example

C#
NOT(Sales[Units] > 100)

Returns TRUE if Units are less than or equal to 100.

IF function in DAX

Returns one value if the condition is TRUE, another if FALSE.

Syntax

C#
IF(logical_test, value_if_true, value_if_false)

Example

C#
IF(Sales[Units] > 100, "High", "Low")

Returns "High" if Units exceed 100, else "Low".

SWITCH function in DAX

Evaluate a list of cases and return the result of the first matching case.

Syntax

C#
SWITCH(expression, case1, result1, case2, result2, ...)

Example

C#
SWITCH(Sales[Country], "USA", "North America", "France", "Europe")

Returns continent based on country.