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

CURRENCY(number, decimal_places, locale)

Example

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

FIXED(number, decimals)

Example

FIXED([Cost], 2)

Rounds Cost to 2 decimal places.

INT

Rounds a number down to the nearest integer.

Syntax

INT(number)

Example

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

ROUND(number, decimals)

Example

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

ROUNDUP(number, decimals)

Example

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

ISBLANK(value)

Example

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

ISERROR(value)

Example

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

ISEVEN(value)

Example

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

ISODD(value)

Example

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

USERNAME()

Example

"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

AND(logical1, logical2, ...)

Example

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

OR(logical1, logical2, ...)

Example

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

NOT(logical)

Example

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

IF(logical_test, value_if_true, value_if_false)

Example

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

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

Example

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

Returns continent based on country.