Appendix A
DAX Functions

As an Excel pro, you probably have a fairly good handle on the calculation functions used in Excel. Today, you might need to dabble in the Data Analysis Expressions (DAX) formula language when creating a new measure in a pivot table. This appendix is a categorized list of the DAX functions with the syntax and a short description.

The first table is an alphabetical list of Excel functions and the equivalent DAX function. If the Excel function is not in Table A.1, then there is no direct DAX equivalent.

Table A.1 Excel Functions with DAX Equivalents

Excel Function

DAX Equivalent

Category

ABS

ABS

Math & Trig (Table A.7)

ACOS

ACOS

Math & Trig (Table A.7)

ACOSH

ACOSH

Math & Trig (Table A.7)

AND

AND

Logical (Table A.6)

ASIN

ASIN

Math & Trig (Table A.7)

ASINH

ASINH

Math & Trig (Table A.7)

ATAN

ATAN

Math & Trig (Table A.7)

ATANH

ATANH

Math & Trig (Table A.7)

AVERAGE

AVERAGE

Statistical (Table A.10)

AVERAGEA

AVERAGEA

Statistical (Table A.10)

BETA.DIST

BETA.DIST

Statistical (Table A.10)

BETA.INV

BETA.INV

Statistical (Table A.10)

CEILING

CEILING

Math & Trig (Table A.7)

CEILING.MATH

ISO.CEILING

Math & Trig (Table A.7)

CHISQ.INV

CHISQ.INV

Statistical (Table A.10)

CHISQ.INV.RT

CHISQ.INV.RT

Statistical (Table A.10)

CODE

CODE

Text (Table A.11)

COMBIN

COMBIN

Math & Trig (Table A.7)

COMBINA

COMBINA

Math & Trig (Table A.7)

CONCATENATE

CONCATENATE

Text (Table A.11)

CONFIDENCE.NORM

CONFIDENCE.NORM

Statistical (Table A.10)

CONFIDENCE.T

CONFIDENCE.T

Statistical (Table A.10)

COS

COS

Math & Trig (Table A.7)

COSH

COSH

Math & Trig (Table A.7)

COUNT

COUNT

Statistical (Table A.10)

COUNTA

COUNTA

Statistical (Table A.10)

COUNTBLANK

COUNTBLANK

Statistical (Table A.10)

DATE

DATE

Date & Time (Table A.2)

DATEDIF

DATEDIFF

Date & Time (Table A.2)

DATEVALUE

DATEVALUE

Date & Time (Table A.2)

DAY

DAY

Date & Time (Table A.2)

DEGREES

DEGREES

Math & Trig (Table A.7)

DIVIDE

DIVIDE

Math & Trig (Table A.7)

EDATE

EDATE

Date & Time (Table A.2)

EOMONTH

EOMONTH

Date & Time (Table A.2)

EVEN

EVEN

Math & Trig (Table A.7)

EXACT

EXACT

Text (Table A.11)

EXP

EXP

Math & Trig (Table A.7)

EXPON.DIST

EXPON.DIST

Statistical (Table A.10)

FACT

FACT

Math & Trig (Table A.7)

FALSE

FALSE

Logical (Table A.6)

FILTER

FILTER

Filter (Table A.4)

FIND

FIND

Text (Table A.11)

FIXED

FIXED

Text (Table A.11)

FLOOR.MATH

FLOOR

Math & Trig (Table A.7)

GCD

GCD

Math & Trig (Table A.7)

GEOMEAN

GEOMEAN

Statistical (Table A.10)

HOUR

HOUR

Date & Time (Table A.2)

IF

IF

Logical (Table A.6)

IFERROR

IFERROR

Logical (Table A.6)

INT

INT

Math & Trig (Table A.7)

INT

INT

Math & Trig (Table A.7)

ISBLANK

ISBLANK

Information (Table A.5)

ISERROR

ISERROR

Information (Table A.5)

ISEVEN

ISEVEN

Information (Table A.5)

ISLOGICAL

ISLOGICAL

Information (Table A.5)

ISNONTEXT

ISNONTEXT

Information (Table A.5)

ISNUMBER

ISNUMBER

Information (Table A.5)

ISTEXT

ISTEXT

Information (Table A.5)

LCM

LCM

Math & Trig (Table A.7)

LEFT

LEFT

Text (Table A.11)

LEN

LEN

Text (Table A.11)

LN

LN

Math & Trig (Table A.7)

LOG

LOG

Math & Trig (Table A.7)

LOG10

LOG10

Math & Trig (Table A.7)

LOWER

LOWER

Text (Table A.11)

MAX

MAX

Statistical (Table A.10)

MAXA

MAXA

Statistical (Table A.10)

MEDIAN

MEDIAN

Statistical (Table A.10)

MID

MID

Text (Table A.11)

MIN

MIN

Statistical (Table A.10)

MINA

MINA

Statistical (Table A.10)

MINUTE

MINUTE

Date & Time (Table A.2)

MONTH

MONTH

Date & Time (Table A.2)

MROUND

MROUND

Math & Trig (Table A.7)

NORM.DIST

NORM.DIST

Statistical (Table A.10)

NORM.INV

NORM.INV

Statistical (Table A.10)

NORM.S.DIST

NORM.S.DIST

Statistical (Table A.10)

NORM.S.INV

NORM.S.INV

Statistical (Table A.10)

NOT

NOT

Logical (Table A.6)

NOW

NOW

Date & Time (Table A.2)

ODD

ODD

Math & Trig (Table A.7)

OR

OR

Logical (Table A.6)

PERCENTILE.EXC

PERCENTILE.EXC

Statistical (Table A.10)

PERCENTILE.INC

PERCENTILE.INC

Statistical (Table A.10)

PI

PI

Math & Trig (Table A.7)

POISSON.DIST

POISSON.DIST

Statistical (Table A.10)

POWER

POWER

Math & Trig (Table A.7)

PRODUCT

PRODUCT

Math & Trig (Table A.7)

QUOTIENT

QUOTIENT

Math & Trig (Table A.7)

RADIANS

RADIANS

Math & Trig (Table A.7)

RAND

RAND

Math & Trig (Table A.7)

RANDBETWEEN

RANDBETWEEN

Math & Trig (Table A.7)

RANK.EQ

RANK.EQ

Statistical (Table A.10)

REPLACE

REPLACE

Text (Table A.11)

REPT

REPT

Text (Table A.11)

RIGHT

RIGHT

Text (Table A.11)

ROUND

ROUND

Math & Trig (Table A.7)

ROUNDDOWN

ROUNDDOWN

Math & Trig (Table A.7)

ROUNDUP

ROUNDUP

Math & Trig (Table A.7)

SEARCH

SEARCH

Text (Table A.11)

SECOND

SECOND

Date & Time (Table A.2)

SIGN

SIGN

Math & Trig (Table A.7)

SIN

SIN

Statistical (Table A.10)

SINH

SINH

Statistical (Table A.10)

SQRT

SQRT

Math & Trig (Table A.7)

SQRTPI

SQRTPI

Statistical (Table A.10)

STDEV.P

STDEV.P

Statistical (Table A.10)

STDEV.S

STDEV.S

Statistical (Table A.10)

SUBSTITUTE

SUBSTITUTE

Text (Table A.11)

SUM

SUM

Math & Trig (Table A.7)

SUMIFS

CALCULATE

Filter (Table A.4)

SWITCH

SWITCH

Logical (Table A.6)

T.DIST

T.DIST

Statistical (Table A.10)

T.DIST.2T

T.DIST.2T

Statistical (Table A.10)

T.DIST.RT

T.DIST.RT

Statistical (Table A.10)

T.INV

T.INV

Statistical (Table A.10)

T.INV.2T

T.INV.2T

Statistical (Table A.10)

TAN

TAN

Statistical (Table A.10)

TANH

TANH

Statistical (Table A.10)

TEXT

FORMAT

Text (Table A.11)

TEXTJOIN

CONCATENATEX

Text (Table A.11)

TIME

TIME

Date & Time (Table A.2)

TIMEVALUE

TIMEVALUE

Date & Time (Table A.2)

TODAY

TODAY

Date & Time (Table A.2)

TRIM

TRIM

Text (Table A.11)

TRUE

TRUE

Logical (Table A.6)

TRUNC

TRUNC

Math & Trig (Table A.7)

UNICHAR

UNICHAR

Text (Table A.11)

UNIQUE

DISTINCT

Filter (Table A.4)

UNIQUE

VALUES

Filter (Table A.4)

UPPER

UPPER

Text (Table A.11)

VALUE

VALUE

Text (Table A.11)

VAR.P

VAR.P

Statistical (Table A.10)

VAR.S

VAR.S

Statistical (Table A.10)

VLOOKUP

RELATED

Filter (Table A.4)

WEEKDAY

WEEKDAY

Date & Time (Table A.2)

WEEKNUM

WEEKNUM

Date & Time (Table A.2)

XIRR

XIRR

Statistical (Table A.10)

XNPV

XNPV

Statistical (Table A.10)

YEAR

YEAR

Date & Time (Table A.2)

YEARFRAC

YEARFRAC

Date & Time (Table A.2)

If you compare Table A.1 below to Table B.1 in Appendix B, you will note that in 90% of the cases, the function names are the same. That is likely thanks to Rob Collie, and Excel Project Manager who moved over to the Power Pivot team. In Appendix B, there are hardly any similarities between the Power Query functions and their Excel equivalents.

Excel Functions and DAX Equivalents

Table A.1 shows an alphabetical list of Excel functions with their DAX equivalents.

Date and Time Functions in DAX

Table A.2 lists Date and Time Functions in DAX.

Table A.2 Date and Time Functions in DAX

Function

Description

CALENDAR(<start_date>, <end_date>)

Returns a table with a single column named “Date” that contains a contiguous set of dates. The range of dates is from the specified start date to the specified end date, inclusive of those two dates.

CALENDARAUTO([fiscal_year_end_month])

Returns a table with a single column named “Date” that contains a contiguous set of dates. The range of dates is calculated automatically based on data in the model.

DATE(<year>, <month>, <day>)

Returns the specified date in datetime format. Similar to Excel function DATE.

DATEDIFF(<start_date>, <end_date>, <interval>)

Returns the count of interval boundaries crossed between two dates. Similar to Excel function DATEDIF.

DATEVALUE(date_text)

Converts a date in the form of text to a date in datetime format. Similar to Excel function DATEVALUE.

DAY(<date>) -

Returns the day of the month, a number from 1 to 31. Similar to Excel function DAY.

EDATE(<start_date>, <months>)

Returns the date that is the indicated number of months before or after the start date. Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue. Similar to Excel function EDATE.

EOMONTH(<start_date>, <months>)

Returns the date in datetime format of the last day of the month, before or after a specified number of months. Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month. Similar to Excel function EOMONTH.

HOUR(<datetime>)

Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.). Similar to Excel function HOUR.

MINUTE(<datetime>)

Returns the minute as a number from 0 to 59, given a date and time value. Similar to Excel function MINUTE.

MONTH(<datetime>)

Returns the month as a number from 1 (January) to 12 (December). Similar to Excel function MONTH.

NOW()

The NOW function is useful when you need to display the current date and time on a worksheet or calculate a value based on the current date and time, and have that value updated each time you open the worksheet. Similar to Excel function NOW.

SECOND(<time>)

Returns the seconds of a time value, as a number from 0 to 59. Similar to Excel function SECOND.

TIME(hour, minute, second)

Converts hours, minutes, and seconds given as numbers to a time in datetime format. Similar to Excel function TIME.

TIMEVALUE(time_text)

Converts a time in text format to a time in datetime format. Similar to Excel function TIMEVALUE.

TODAY()

Returns the current date. Similar to Excel function TODAY.

WEEKDAY(<date>, <return_type>)

Returns a number from 1 to 7 identifying the day of the week of a date. By default, the day ranges from 1 (Sunday) to 7 (Saturday). Similar to Excel function WEEKDAY.

WEEKNUM(<date>, <return_type>)

Returns the week number for the given date and year according to the return_type value. The week number indicates where the week falls numerically within a year. Similar to Excel function WEEKNUM.

YEAR(<date>)

Returns the year of a date as a four-digit integer in the range 1900-9999. Similar to Excel function YEAR.

YEARFRAC(<start_date>, <end_date>, <basis>)

Calculates the fraction of the year represented by the number of whole days between two dates. Use the YEARFRAC worksheet function to identify the proportion of a whole year’s benefits or obligations to assign to a specific term. Similar to Excel function YEARFRAC.

Time Intelligence Functions in DAX

Table A.3 shows Time Intelligence Function in DAX.

Table A.3 Time Intelligence Functions in DAX

Function

Description

CLOSINGBALANCEMONTH(<expression>,<dates>[,<filter>])

Evaluates the expression at the last date of the month in the current context.

CLOSINGBALANCEQUARTER(<expression>,<dates>[,<filter>])

Evaluates the expression at the last date of the quarter in the current context.

CLOSINGBALANCEYEAR(<expression>,<dates>[,<filter>][,<year_end_date>])

Evaluates the expression at the last date of the year in the current context.

DATEADD(<dates>,<number_of_intervals>,<interval>)

Returns a table that contains a column of dates, shifted either forward or backward in time by the specified number of intervals from the dates in the current context.

DATESBETWEEN(<dates>,<start_date>,<end_date>)

Returns a table that contains a column of dates that begins with the start_date and continues until the end_date.

DATESINPERIOD(<dates>,<start_date>,<number_of_intervals>,<interval>)

Returns a table that contains a column of dates that begins with the start_date and continues for the specified number_of_intervals.

DATESMTD(<dates>)

Returns a table that contains a column of the dates for the month to date, in the current context.

DATESQTD(<dates>)

Returns a table that contains a column of the dates for the quarter to date, in the current context.

DATESYTD(<dates> [,<year_end_date>])

Returns a table that contains a column of the dates for the year to date, in the current context.

ENDOFMONTH(<dates>) -

Returns the last date of the month in the current context for the specified column of dates.

ENDOFQUARTER(<dates>)

Returns the last date of the quarter in the current context for the specified column of dates.

ENDOFYEAR(<dates> [,<year_end_date>])

Returns the last date of the year in the current context for the specified column of dates.

FIRSTDATE(<dates>)

Returns the first date in the current context for the specified column of dates.

FIRSTNONBLANK(<column>,<expression>)

Returns the first value in the column, column, filtered by the current context, where the expression is not blank.

LASTDATE(<dates>)

Returns the last date in the current context for the specified column of dates.

LASTNONBLANK(<column>,<expression>)

Returns the last value in the column, column, filtered by the current context, where the expression is not blank.

NEXTDAY(<dates>)

Returns a table that contains a column of all dates from the next day, based on the first date specified in the dates column in the current context.

NEXTMONTH(<dates>)

Returns a table that contains a column of all dates from the next month, based on the first date in the dates column in the current context.

NEXTQUARTER(<dates>)

Returns a table that contains a column of all dates in the next quarter, based on the first date specified in the dates column, in the current context.

NEXTYEAR(<dates>[,<year_end_date>])

Returns a table that contains a column of all dates in the next year, based on the first date in the dates column, in the current context.

OPENINGBALANCEMONTH(<expression>,<dates>[,<filter>])

Evaluates the expression at the first date of the month in the current context.

OPENINGBALANCEQUARTER(<expression>,<dates>[,<filter>]) -

Evaluates the expression at the first date of the quarter, in the current context.

OPENINGBALANCEYEAR(<expression>,<dates>[,<filter>][,<year_end_date>])

Evaluates the expression at the first date of the year in the current context.

PARALLELPERIOD(<dates>,<number_of_intervals>,<interval>)

Returns a table that contains a column of dates that represents a period parallel to the dates in the specified dates column, in the current context, with the dates shifted a number of intervals either forward in time or back in time.

PREVIOUSDAY(<dates>)

Returns a table that contains a column of all dates representing the day that is previous to the first date in the dates column, in the current context.

PREVIOUSMONTH(<dates>)

Returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context.

PREVIOUSQUARTER(<dates>)

Returns a table that contains a column of all dates from the previous quarter, based on the first date in the dates column, in the current context.

PREVIOUSYEAR(<dates>[,<year_end_date>])

Returns a table that contains a column of all dates from the previous year, given the last date in the dates column, in the current context.

SAMEPERIODLASTYEAR(<dates>)

Returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.

STARTOFMONTH(<dates>)

Returns the first date of the month in the current context for the specified column of dates.

STARTOFQUARTER(<dates>)

Returns the first date of the quarter in the current context for the specified column of dates.

STARTOFYEAR(<dates>)

Returns the first date of the year in the current context for the specified column of dates.

TOTALMTD(<expression>,<dates>[,<filter>])

Evaluates the value of the expression for the month to date, in the current context.

TOTALQTD(<expression>,<dates>[,<filter>])

Evaluates the value of the expression for the dates in the quarter to date, in the current context.

TOTALYTD(<expression>,<dates>[,<filter>][,<year_end_date>])

Evaluates the year-to-date value of the expression in the current context.

Filter Functions in DAX

Table A.4 shows Filter Functions in DAX.

Table A.4 Filter Functions in DAX

Function

Description

ADDMISSINGITEMS(<showAllColumn>[, <showAllColumn>]…, <table>, <groupingColumn>[, <groupingColumn>]…[,

The ADDMISSINGITEMS function will return BLANK values for the IsSubtotal columns of blank rows it adds.

ALL({<table>|<column>

[,<column>[,<column>[,...]]]})

Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.

ALLEXCEPT(<table>,<column>[,<column>[,…]])

Removes all context filters in the table except filters that have been applied to the specified columns.

ALLNOBLANKROW(

{<table>|<column>

[,<column>[,<column>[,…]]]})

From the parent table of a relationship, returns all rows but the blank row, or all distinct values of a column but the blank row, and disregards any context filters that might exist.

ALLSELECTED([<tableName> | <columnName>])

The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

CALCULATE(<expression>,<filter1>,<filter2>…)

Evaluates an expression in a context that is modified by the specified filters. Similar to Excel function SUMIFS*.

CALCULATETABLE(<expression>,<filter1>,<filter2>,…)

Evaluates a table expression in a context modified by the given filters.

CROSSFILTER(<columnName1>, <columnName2>, <direction>)

Specifies the cross-filtering direction to be used in a calculation for a relationship that exists between two columns.

DISTINCT(<column>)

This function cannot be used to return values into a cell or column on a worksheet; rather, you nest the DISTINCT function within a formula, to get a list of distinct values that can be passed to another function and then counted, summed, or used for other operations. Similar to Excel function UNIQUE.

EARLIER(<column>, <number>)

EARLIER is mostly used in the context of calculated columns.

EARLIEST(<column>)

Returns the current value of the specified column in an outer evaluation pass of the specified column.

FILTER(<table>,<filter>)

Returns a table that represents a subset of another table or expression. Similar to Excel function FILTER.

FILTERS(<columnName>)

Returns the values that are directly applied as filters to columnName.

HASONEFILTER(<columnName>)

Returns TRUE when the number of directly filtered values on columnName is one; otherwise returns FALSE.

HASONEVALUE(<columnName>)

Returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherwise is FALSE.

ISCROSSFILTERED(<columnName>)

Returns TRUE when columnName or another column in the same or related table is being filtered.

ISFILTERED(<columnName>)

Returns TRUE when columnName is being filtered directly. If there is no filter on the column or if the filtering happens because a different column in the same table or in a related table is being filtered, then the function returns FALSE.

KEEPFILTERS(<expression>)

Modifies how filters are applied while evaluating a CALCULATE or CALCULATETABLE function.

RELATED(<column>)

Returns a related value from another table. Similar to Excel function VLOOKUP.

RELATEDTABLE(<tableName>)

Evaluates a table expression in a context modified by the given filters.

SELECTEDVALUE(<columnName>[, <alternateResult>])

Returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.

SUBSTITUTEWITHINDEX(<table>,

<indexColumnName>,<indexColumnsTable>,

[<orderBy_expression>,[<order>]

[,<orderBy_expression>,

[<order>]]…])

The index starts at 0 (0-based) and is incremented by one for each additional row in the right/second join table supplied. The index is based on the sort order specified for the right/second join table.

USERELATIONSHIP(<columnName1>,<columnName2>)

Specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2.

VALUES(<TableNameOrColumnName>)

This function cannot be used to return values into a cell or column on a worksheet; rather, you use it as an intermediate function, nested in a formula, to get a list of distinct values that can be counted, or to filter or sum other values. Similar to Excel function UNIQUE.

Information Functions in DAX

Table A.5 shows Information Functions in DAX.

Table A.5 Information Functions in DAX

Function

Description

CONTAINS(<table>, <columnName>, <value>[, <columnName>, <value>]…) -

Returns true if values for all referred columns exist, or are contained, in those columns; otherwise, the function returns false.

CUSTOMDATA()

Returns the content of the CustomData property in the connection string.

ISBLANK(<value>)

Checks whether a value is blank and returns TRUE or FALSE. Similar to Excel function ISBLANK.

ISERROR(<value>)

Checks whether a value is an error and returns TRUE or FALSE. Similar to Excel function ISERROR.

ISEVEN(number)

Returns TRUE if number is even, or FALSE if number is odd. Similar to Excel function ISEVEN.

ISLOGICAL(<value>)

Checks whether a value is a logical value (TRUE or FALSE), and returns TRUE or FALSE. Similar to Excel function ISLOGICAL.

ISNONTEXT(<value>)

Checks if a value is not text (blank cells are not text) and returns TRUE or FALSE. Similar to Excel function ISNONTEXT.

ISNUMBER(<value>)

Checks whether a value is a number and returns TRUE or FALSE. Similar to Excel function ISNUMBER.

ISONORAFTER(<scalar_expression>,

<scalar_expression>, sort_order,

[,scalar_expression>, <scalar_expression>,

[sort_order][,…])

Based on the sort order, the first parameter is compared with the second parameter. If the sort order is ascending, the comparison to be done is first parameter greater than or equal to second parameter. If the sort order is descending, the comparison to be done is second parameter less than or equal to first parameter.

ISTEXT(<value>)

Checks if a value is text and returns TRUE or FALSE. Similar to Excel function ISTEXT.

LOOKUPVALUE(<result_columnName>,

<search_columnName>, <search_value>

[,<search_columnName>,<search_value>]…)

Returns the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value.

USERNAME()

Returns the domain name and username from the credentials given to the system at connection time.

Logical Functions in DAX

Table A.6 shows Logical Functions in DAX.

Table A.6 Logical Functions in DAX

FUNCTION

DESCRIPTION

AND(<logical1>,<logical2>)

Checks whether both arguments are TRUE and returns TRUE if both arguments are TRUE. Otherwise returns false. Similar to Excel function AND.

FALSE()

Returns the logical value FALSE. Similar to Excel function FALSE.

IF(logical_test>,<value_if_true>, value_if_false)

Checks if a condition provided as the first argument is met. Returns one value if the condition is TRUE, and returns another value if the condition is FALSE. Similar to Excel function IF.

IFERROR(value, value_if_error)

Evaluates an expression and returns a specified value if the expression returns an error; otherwise returns the value of the expression itself. Similar to Excel function IFERROR.

NOT(<logical>)

Changes FALSE to TRUE, or TRUE to FALSE. Similar to Excel function NOT.

OR(<logical1>,<logical2>)

Checks whether one of the arguments is TRUE to return TRUE. The function returns FALSE if both arguments are FALSE. Similar to Excel function OR.

SWITCH(<expression>,<value>,

<result>[,<value>,<result>]…

[, <else>])

Evaluates an expression against a list of values and returns one of multiple possible result expressions. Similar to Excel function SWITCH.

TRUE()

Returns the logical value TRUE. Similar to Excel function TRUE.

Math and Trig Functions in DAX

Table A.7 shows Math and Trig Functions in DAX.

Table A.7 Math and Trig Functions in DAX

Function

Description

ABS(<number>)

Returns the absolute value of a number. Similar to Excel function ABS.

ACOS(number)

Returns the arccosine, or inverse cosine, of a number. The arccosine is the angle whose cosine is number. The returned angle is given in radians in the range 0 (zero) to pi. Similar to Excel function ACOS.

ACOSH(number)

Returns the inverse hyperbolic cosine of a number. The number must be greater than or equal to 1. The inverse hyperbolic cosine is the value whose hyperbolic cosine is number, so ACOSH(COSH(number)) equals number. Similar to Excel function ACOSH.

ASIN(number)

Returns the arcsine, or inverse sine, of a number. The arcsine is the angle whose sine is number. The returned angle is given in radians in the range -pi/2 to pi/2. Similar to Excel function ASIN.

ASINH(number)

Returns the inverse hyperbolic sine of a number. The inverse hyperbolic sine is the value whose hyperbolic sine is number, so ASINH(SINH(number)) equals number. Similar to Excel function ASINH.

ATAN(number)

Returns the arctangent, or inverse tangent, of a number. The arctangent is the angle whose tangent is number. The returned angle is given in radians in the range -pi/2 to pi/2. Similar to Excel function ATAN.

ATANH(number)

Returns the inverse hyperbolic tangent of a number. Number must be between -1 and 1 (excluding -1 and 1). The inverse hyperbolic tangent is the value whose hyperbolic tangent is number, so ATANH(TANH(number)) equals number. Similar to Excel function ATANH.

CEILING(<number>, <significance>)

Rounds a number up, to the nearest integer or to the nearest multiple of significance. Similar to Excel function CEILING.

COMBIN(number, number_chosen)

Returns the number of combinations for a given number of items. Use COMBIN to determine the total possible number of groups for a given number of items. Similar to Excel function COMBIN.

COMBINA(number, number_chosen)

Returns the number of combinations (with repetitions) for a given number of items. Similar to Excel function COMBINA.

COS(number)

Returns the cosine of the given angle. Similar to Excel function COS.

COSH(number)

Returns the hyperbolic cosine of a number. Similar to Excel function COSH.

CURRENCY(<value>)

Evaluates the argument and returns the result as currency data type.

DEGREES(angle)

Converts radians into degrees. Similar to Excel function DEGREES.

DIVIDE(<numerator>, <denominator> [,<alternateresult>])

Performs division and returns alternate result or BLANK() on division by 0. Similar to Excel function DIVIDE.

EVEN(number)

Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate’s capacity. Similar to Excel function EVEN.

EXP(<number>)

Returns e raised to the power of a given number. The constant e equals 2.71828182845904, the base of the natural logarithm. Similar to Excel function EXP.

FACT(<number>)

Returns the factorial of a number, equal to the series 1*2*3*...* , ending in the given number. Similar to Excel function FACT.

FLOOR(<number>, <significance>)

Rounds a number down, toward zero, to the nearest multiple of significance. Similar to Excel function FLOOR.MATH.

GCD(number1, [number2], ...)

Returns the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder. Similar to Excel function GCD.

INT(<number>)

Rounds a number down to the nearest integer. Similar to Excel function INT.

ISO.CEILING(<number>[, <significance>])

Rounds a number up, to the nearest integer or to the nearest multiple of significance. Similar to Excel function CEILING.MATH.

LCM(number1, [number2], ...)

Returns the least common multiple of integers. The least common multiple is the smallest positive integer that is a multiple of all integer arguments number1, number2, and so on. Use LCM to add fractions with different denominators. Similar to Excel function LCM.

LN(<number>)

Returns the natural logarithm of a number. Natural logarithms are based on the constant e (2.71828182845904). Similar to Excel function LN.

LOG(<number>,<base>)

Returns the logarithm of a number to the base you specify. Similar to Excel function LOG.

LOG10(<number>)

Returns the base-10 logarithm of a number. Similar to Excel function LOG10.

INT(<number>)

Rounds a number down to the nearest integer. Similar to Excel function INT.

MROUND(<number>, <multiple>)

Returns a number rounded to the desired multiple. Similar to Excel function MROUND.

ODD(number)

Returns number rounded up to the nearest odd integer. Similar to Excel function ODD.

PI()

Returns the value of Pi, 3.14159265358979, accurate to 15 digits. Similar to Excel function PI.

POWER(<number>, <power>)

Returns the result of a number raised to a power. Similar to Excel function POWER.

PRODUCT(<column>)

To return the product of an expression evaluated for each row in a table, use PRODUCTX Function (DAX). Similar to Excel function PRODUCT.

PRODUCTX(<table>, <expression>)

To return the product of the numbers in a column, use PRODUCT Function (DAX).

QUOTIENT(<numerator>, <denominator>)

Performs division and returns only the integer portion of the division result. Use this function when you want to discard the remainder of division. Similar to Excel function QUOTIENT.

RADIANS(angle)

Converts degrees to radians. Similar to Excel function RADIANS.

RAND()

Returns a random number greater than or equal to 0 and less than 1, evenly distributed. The number that is returned changes each time the cell containing this function is recalculated. Similar to Excel function RAND.

RANDBETWEEN(<bottom>,<top>)

Returns a random number in the range between two numbers you specify. Similar to Excel function RANDBETWEEN.

ROUND(<number>, <num_digits>)

Rounds a number to the specified number of digits. Similar to Excel function ROUND.

ROUNDDOWN(<number>, <num_digits>)

Rounds a number down, toward zero. Similar to Excel function ROUNDDOWN.

ROUNDUP(<number>, <num_digits>)

Rounds a number up, away from 0 (zero). Similar to Excel function ROUNDUP.

SIGN(<number>)

Determines the sign of a number, the result of a calculation, or a value in a column. The function returns 1 if the number is positive, 0 (zero) if the number is zero, or -1 if the number is negative. Similar to Excel function SIGN.

SQRT(<number>)

Returns the square root of a number. Similar to Excel function SQRT.

SUM(<column>)

Adds all the numbers in a column. Similar to Excel function SUM.

SUMX(<table>, <expression>)

Returns the sum of an expression evaluated for each row in a table.

TRUNC(<number>,<num_digits>)

Truncates a number to an integer by removing the decimal, or fractional, part of the number. Similar to Excel function TRUNC.

Other Functions in DAX

Table A.8 lists other functions in DAX.

Table A.8 Other Functions in DAX

Function

Description

DATATABLE(ColumnName1,DataType1,

ColumnName2,DataType2...,

{{Value1, Value2...},

{ValueN, ValueN+1...}...})

Provides a mechanism for declaring an inline set of data values.

ERROR(<text>)

Raises an error with an error message.

EXCEPT(<table_expression1>, <table_expression2>

Returns the rows of one table which do not appear in another table.

GENERATESERIES(<startValue>, <endValue>[, <incrementValue>])

Returns a single column table containing the values of an arithmetic series—that is, a sequence of values in which each differs from the preceding by a constant quantity. The name of the column returned is Value.

GROUPBY(<table>,

[<groupBy_columnName1>],

[<name>, <expression>]…)

The GROUPBY function is similar to the SUMMARIZE function. However, GROUPBY does not do an implicit CALCULATE for any extension columns that it adds. GROUPBY permits a new function, CURRENTGROUP(), to be used inside aggregation functions in the extension columns that it adds. GROUPBY attempts to reuse the data that has been grouped making it highly performant.

INTERSECT(<table_expression1>, <table_expression2>)

Returns the row intersection of two tables, retaining duplicates.

ISEMPTY(<table_expression>)

Checks if a table is empty.

NATURALINNERJOIN(<leftJoinTable>, <rightJoinTable>)

Performs an inner join of a table with another table. The tables are joined on common columns (by name) in the two tables. If the two tables have no common column names, an error is returned.

NATURALLEFTOUTERJOIN(<leftJoinTable>, <rightJoinTable>)

Performs an inner join of a table with another table. The tables are joined on common columns (by name) in the two tables. If the two tables have no common column names, an error is returned.

SUMMARIZECOLUMNS(<groupBy_columnName>

[,< groupBy_columnName >]…,

[<filterTable>]…

[, <name>, <expression>]…)

Returns a summary table over a set of groups.

TREATAS(table_expression, <column>[, <column>[, <column>[,…]]]} )

Applies the result of a table expression as filters to columns from an unrelated table.

UNION(<table_expression1>, <table_expression2> [,<table_expression>]…)

Creates a union (join) table from a pair of tables.

VAR <name> = <expression>

Stores the result of an expression as a named variable, which can then be passed as an argument to other measure expressions. Once resultant values have been calculated for a variable expression, those values do not change, even if the variable is referenced in another expression.

Parent and Child Functions in DAX

Table A.9 lists Parent and Child Functions in DAX.

Table A.9 Parent and Child Functions in DAX

Function

Description

PATH(<ID_columnName>, <parent_columnName>)

Returns a delimited text string with the identifiers of all the parents of the current identifier, starting with the oldest and continuing until current.

PATHCONTAINS(<path>, <item>)

Returns TRUE if the specified item exists within the specified path.

PATHITEM(<path>, <position>[, <type>])

Returns the item at the specified position from a string resulting from evaluation of a PATH function. Positions are counted from left to right.

PATHITEMREVERSE(<path>, <position>[, <type>])

Returns the item at the specified position from a string resulting from evaluation of a PATH function. Positions are counted backwards from right to left.

PATHLENGTH(<path>)

Returns the number of parents to the specified item in a given PATH result, including self.

Statistical Functions in DAX

Table A.10 lists Statistical Functions in DAX.

Table A.10 Statistical Functions in Dax

Function

Description

ADDCOLUMNS(<table>, <name>, <expression>[, <name>, <expression>]…)

Adds calculated columns to the given table or table expression.

AVERAGE(<column>)

Returns the average (arithmetic mean) of all the numbers in a column. Similar to Excel function AVERAGE.

AVERAGEA(<column>)

Returns the average (arithmetic mean) of the values in a column. Handles text and non-numeric values. Similar to Excel function AVERAGEA.

AVERAGEX(<table>,<expression>)

Calculates the average (arithmetic mean) of a set of expressions evaluated over a table.

BETA.DIST(x,alpha,beta,cumulative,[A],[B])

Returns the beta distribution. The beta distribution is commonly used to study variation in the percentage of something across samples, such as the fraction of the day people spend watching television. Similar to Excel function BETA.DIST.

BETA.INV(probability,alpha,beta,[A],[B])

If probability = BETA.DIST(x,...TRUE), then BETA.INV(probability,...) = x. The beta distribution can be used in project planning to model probable completion times given an expected completion time and variability. Similar to Excel function BETA.INV.

CHISQ.INV(probability,deg_freedom)

The chi-squared distribution is commonly used to study variation in the percentage of something across samples, such as the fraction of the day people spend watching television. Similar to Excel function CHISQ.INV.

CHISQ.INV.RT(probability,deg_freedom)

If probability = CHISQ.DIST.RT(x,...), then CHISQ.INV.RT(probability,...) = x. Use this function to compare observed results with expected ones in order to decide whether your original hypothesis is valid. Similar to Excel function CHISQ.INV.RT.

CONFIDENCE.NORM(alpha,standard_dev,size)

The confidence interval is a range of values. Your sample mean, x, is at the center of this range and the range is x ± CONFIDENCE.NORM. For example, if x is the sample mean of delivery times for products ordered through the mail, x ± CONFIDENCE.NORM is a range of population means. For any population mean, μ0, in this range, the probability of obtaining a sample mean further from μ0 than x is greater than alpha; for any population mean, μ0, not in this range, the probability of obtaining a sample mean further from μ0 than x is less than alpha. In other words, assume that we use x, standard_dev, and size to construct a two-tailed test at significance level alpha of the hypothesis that the population mean is μ0. Then we will not reject that hypothesis if μ0 is in the confidence interval and will reject that hypothesis if μ0 is not in the confidence interval. The confidence interval does not allow us to infer that there is probability 1 – alpha that our next package will take a delivery time that is in the confidence interval. Similar to Excel function CONFIDENCE.NORM.

CONFIDENCE.T(alpha,standard_dev,size)

Returns the confidence interval for a population mean, using a Student’s t distribution. Similar to Excel function CONFIDENCE.T.

COUNT(<column>)

The COUNT function counts the number of cells in a column that contain numbers. Similar to Excel function COUNT.

COUNTA(<column>)

The COUNTA function counts the number of cells in a column that are not empty. It counts not just rows that contain numeric values, but also rows that contain nonblank values, including text, dates, and logical values. Similar to Excel function COUNTA.

COUNTAX(<table>,<expression>)

The COUNTAX function counts nonblank results when evaluating the result of an expression over a table. That is, it works just like the COUNTA function, but is used to iterate through the rows in a table and count rows where the specified expressions results in a nonblank result.

COUNTBLANK(<column>)

Counts the number of blank cells in a column. Similar to Excel function COUNTBLANK.

COUNTROWS(<table>)

The COUNTROWS function counts the number of rows in the specified table, or in a table defined by an expression.

COUNTX(<table>,<expression>)

Counts the number of rows that contain a number or an expression that evaluates to a number, when evaluating an expression over a table.

CROSSJOIN(<table>, <table>[, <table>]…)

Returns a table that contains the Cartesian product of all rows from all tables in the arguments. The columns in the new table are all the columns in all the argument tables.

DATATABLE(ColumnName1, DataType1, ColumnName2, DataType2...,

Provides a mechanism for declaring an inline set of data values.

DISTINCTCOUNT(<column>)

The DISTINCTCOUNT function counts the number of distinct values in a column.

EXPON.DIST(x,lambda,cumulative)

Returns the exponential distribution. Use EXPON.DIST to model the time between events, such as how long an automated bank teller takes to deliver cash. For example, you can use EXPON.DIST to determine the probability that the process takes at most 1 minute. Similar to Excel function EXPON.DIST.

GENERATE(<table1>, <table2>)

Returns a table with the Cartesian product between each row in table1 and the table that results from evaluating table2 in the context of the current row from table1.

GENERATEALL(<table1>, <table2>)

Returns a table with the Cartesian product between each row in table1 and the table that results from evaluating table2 in the context of the current row from table1.

GEOMEAN(<column>)

To return the geometric mean of an expression evaluated for each row in a table, use GEOMEANX Function (DAX). Similar to Excel function GEOMEAN.

GEOMEANX(<table>, <expression>)

To return the geometric mean of the numbers in a column, use GEOMEAN Function (DAX).

MAX(<column>)

Returns the largest numeric value in a column, or between two scalar expressions. Similar to Excel function MAX.

MAXA(<column>)

Returns the largest value in a column. Logical values and blanks are counted. Similar to Excel function MAXA.

MAXX(<table>,<expression>)

Evaluates an expression for each row of a table and returns the largest numeric value.

MEDIAN(<column>)

To return the median of an expresssion evaluated for each row in a table, use MEDIANX Function (DAX). Similar to Excel function MEDIAN.

MEDIANX(<table>, <expression>)

To return the median of numbers in a column, use MEDIAN Function (DAX).

MIN(<column>)

Returns the smallest numeric value in a column, or between two scalar expressions. Ignores logical values and text. Similar to Excel function MIN.

MINA(<column>)

Returns the smallest value in a column, including any logical values and numbers represented as text. Similar to Excel function MINA.

MINX(<table>, < expression>)

Returns the smallest numeric value that results from evaluating an expression for each row of a table.

NORM.DIST(X, Mean, Standard_dev, Cumulative)

Returns the normal distribution for the specified mean and standard deviation. Similar to Excel function NORM.DIST.

NORM.INV(Probability, Mean, Standard_dev)

The inverse of the normal cumulative distribution for the specified mean and standard deviation. Similar to Excel function NORM.INV.

NORM.S.DIST(Z, Cumulative)

Returns the standard normal distribution (has a mean of zero and a standard deviation of one). Similar to Excel function NORM.S.DIST.

NORM.S.INV(Probability)

Returns the inverse of the standard normal cumulative distribution. The distribution has a mean of zero and a standard deviation of one. Similar to Excel function NORM.S.INV.

PERCENTILE.EXC(<column>, <k>)

To return the percentile number of an expression evaluated for each row in a table, use PERCENTILEX.EXC Function (DAX). Similar to Excel function PERCENTILE.EXC.

PERCENTILE.INC(<column>, <k>)

To return the percentile number of an expression evaluated for each row in a table, use PERCENTILEX.INC Function (DAX). Similar to Excel function PERCENTILE.INC.

PERCENTILEX.EXC(<table>, <expression>, k)

To return the percentile of numbers in a column, use PERCENTILE.EXC Function (DAX).

PERCENTILEX.INC(<table>, <expression>, k)

To return the percentile of numbers in a column, use PERCENTILE.INC Function (DAX).

POISSON.DIST(x,mean,cumulative)

Returns the Poisson distribution. A common application of the Poisson distribution is predicting the number of events over a specific time, such as the number of cars arriving at a toll plaza in 1 minute. Similar to Excel function POISSON.DIST.

RANK.EQ(<value>, <columnName>[, <order>])

Returns the ranking of a number in a list of numbers. Similar to Excel function RANK.EQ.

RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]])

Returns the ranking of a number in a list of numbers for each row in the table argument.

ROW(<name>, <expression>[[,<name>, <expression>]…])

Returns a table with a single row containing values that result from the expressions given to each column.

SAMPLE(<n_value>, <table>, <orderBy_expression>, [<order>[, <orderBy_expression>,

Returns a sample of N rows from the specified table.

SELECTCOLUMNS(<table>, <name>, <scalar_expression> [, <name>,

Adds calculated columns to the given table or table expression.

SIN(number)

Returns the sine of the given angle. Similar to Excel function SIN.

SINH(number)

Returns the hyperbolic sine of a number. Similar to Excel function SINH.

STDEV.P(<ColumnName>)

Returns the standard deviation of the entire population. Similar to Excel function STDEV.P.

STDEV.S(<ColumnName>)

Returns the standard deviation of a sample population. Similar to Excel function STDEV.S.

STDEVX.P(<table>, <expression>)

Returns the standard deviation of the entire population.

STDEVX.S(<table>, <expression>)

Returns the standard deviation of a sample population.

SQRTPI(number)

Returns the square root of (number * pi). Similar to Excel function SQRTPI.

SUMMARIZE(<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)

Returns a summary table for the requested totals over a set of groups.

T.DIST(X,Deg_freedom,Cumulative)

Returns the Student’s left-tailed t-distribution. Similar to Excel function T.DIST.

T.DIST.2T(X,Deg_freedom)

Returns the two-tailed Student’s t-distribution. Similar to Excel function T.DIST.2T.

T.DIST.RT(X,Deg_freedom)

Returns the right-tailed Student’s t-distribution. Similar to Excel function T.DIST.RT.

T.INV(Probability,Deg_freedom)

Returns the left-tailed inverse of the Student’s t-distribution. Similar to Excel function T.INV.

T.INV.2T(Probability,Deg_freedom)

Returns the two-tailed inverse of the Student’s t-distribution. Similar to Excel function T.INV.2T.

TAN(number)

Returns the tangent of the given angle. Similar to Excel function TAN.

TANH(number)

Returns the hyperbolic tangent of a number. Similar to Excel function TANH.

TOPN(<n_value>, <table>, <orderBy_expression>, [<order>[, <orderBy_expression>,

Returns the top N rows of the specified table.

VAR.P(<columnName>)

Returns the variance of the entire population. Similar to Excel function VAR.P.

VAR.S(<columnName>)

Returns the variance of a sample population. Similar to Excel function VAR.S.

VARX.P(<table>, <expression>)

Returns the variance of the entire population.

VARX.S(<table>, <expression>)

Returns the variance of a sample population.

XIRR(<table>, <values>, <dates>, [guess])

Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic. Similar to Excel function XIRR.

XNPV(<table>, <values>, <dates>, <rate>)

Returns the present value for a schedule of cash flows that is not necessarily periodic. Similar to Excel function XNPV.

Text Functions in DAX

Table A.11 lists Text Functions in DAX.

Table A.11 Text Functions in DAX

Function

Description

BLANK()

Returns a blank.

CODE(text)

Windows ANSI code for the first character of text. Similar to Excel function CODE.

CONCATENATE(<text1>, <text2>)

Joins two text strings into one text string. Similar to Excel function CONCATENATE.

CONCATENATEX(<table>, <expression>, [delimiter])

Concatenates the result of an expression evaluated for each row in a table. Similar to Excel function TEXTJOIN.

EXACT(<text1>,<text2>)

Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise. EXACT is case-sensitive but ignores formatting differences. You can use EXACT to test text being entered into a document. Similar to Excel function EXACT.

FIND(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])

Returns the starting position of one text string within another text string. FIND is case-sensitive. Similar to Excel function FIND.

FIXED(<number>, <decimals>, <no_commas>)

Rounds a number to the specified number of decimals and returns the result as text. You can specify that the result be returned with or without commas. Similar to Excel function FIXED.

FORMAT(<value>, <format_string>)

Converts a value to text according to the specified format. Similar to Excel function TEXT.

LEFT(<text>, <num_chars>)

Returns the specified number of characters from the start of a text string. Similar to Excel function LEFT.

LEN(<text>)

Returns the number of characters in a text string. Similar to Excel function LEN.

LOWER(<text>)

Converts all letters in a text string to lowercase. Similar to Excel function LOWER.

MID(<text>, <start_num>, <num_chars>)

Returns a string of characters from the middle of a text string, given a starting position and length. Similar to Excel function MID.

REPLACE(<old_text>, <start_num>, <num_chars>, <new_text>)

REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string. Similar to Excel function REPLACE.

REPT(<text>, <num_times>)

Repeats text a given number of times. Use REPT to fill a cell with a number of instances of a text string. Similar to Excel function REPT.

RIGHT(<text>, <num_chars>)

RIGHT returns the last character or characters in a text string, based on the number of characters you specify. Similar to Excel function RIGHT.

SEARCH(<find_text>, <within_text>[, [<start_num>][,<NotFoundValue>]])

Returns the number of the character at which a specific character or text string is first found, reading left to right. Search is case-insensitive and accent sensitive. Similar to Excel function SEARCH.

SUBSTITUTE(<text>, <old_text>, <new_text>, <instance_num>)

Replaces existing text with new text in a text string. Similar to Excel function SUBSTITUTE.

TRIM(<text>)

Removes all spaces from text except for single spaces between words. Similar to Excel function TRIM.

UNICHAR(number)

Returns the Unicode character referenced by the numeric value. Similar to Excel function UNICHAR.

UPPER(<text>)

Converts a text string to all uppercase letters Similar to Excel function UPPER.

VALUE(<text>)

Converts a text string that represents a number to a number. Similar to Excel function VALUE.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.158.173