DAX Functions For Reference

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

DAX Functions

DAX Functions

Category Function Syntax Description


Date and Time Functions DATE Function DATE(<year>, <month>, <day>) Returns the specified date in datetime format.
Converts a date in the form of text to a date in datetime
Date and Time Functions DATEVALUE Function DATEVALUE(date_text)
format.

Date and Time Functions DAY Function DAY(<date>) <<datetime or text>> Returns the day of the month, a number from 1 to 31.

Returns the date that is the indicated number of months


before or after the start date. Use EDATE to calculate
Date and Time Functions EDATE Function EDATE(<start_date>, <months>)
maturity dates or due dates that fall on the same day of
the month as the date of issue.
Returns the date in datetime format of the last day of
the month, before or after a specified number of months.
Date and Time Functions EOMONTH Function EOMONTH(<start_date>, <months>)
Use EOMONTH to calculate maturity dates or due dates
that fall on the last day of the month.
Returns the hour as a number from 0 (12:00 A.M.) to 23
Date and Time Functions HOUR Function HOUR(<datetime>)
(11:00 P.M.).
Returns the minute as a number from 0 to 59, given a
Date and Time Functions MINUTE Function MINUTE(<datetime>)
date and time value.
Returns the month as a number from 1 (January) to 12
Date and Time Functions MONTH Function MONTH(<datetime>)
(December).

The NOW function is useful when you need to display


the current date and time on a worksheet or calculate a
Date and Time Functions NOW Function NOW()
value based on the current date and time, and have that
value updated each time you open the worksheet.

Returns the seconds of a time value, as a number from 0


Date and Time Functions SECOND Function SECOND(<time>)
to 59.
Converts hours, minutes, and seconds given as numbers
Date and Time Functions TIME Function TIME(hour, minute, second)
to a time in datetime format.
Converts a time in text format to a time in datetime
Date and Time Functions TIMEVALUE Function TIMEVALUE(time_text)
format.
Date and Time Functions TODAY Function TODAY() Returns the current date.
Returns a number from 1 to 7 identifying the day of the
Date and Time Functions WEEKDAY Function WEEKDAY(<date>, <return_type>) week of a date. By default the day ranges from 1
(Sunday) to 7 (Saturday).

Returns the week number for the given date and year
Date and Time Functions WEEKNUM Function WEEKNUM(<date>, <return_type>) according to the return_type value. The week number
indicates where the week falls numerically within a year.

Returns the year of a date as a four digit integer in the


Date and Time Functions YEAR Function YEAR(<date>)
range 1900-9999.
alculates the fraction of the year represented by the
number of whole days between two dates. Use the
YEARFRAC(<start_date>, <end_date>,
Date and Time Functions YEARFRAC Function YEARFRAC worksheet function to identify the proportion
<basis>)
of a whole year's benefits or obligations to assign to a
specific term.
CLOSINGBALANCEMONTH CLOSINGBALANCEMONTH(<expression>,<da Evaluates the expression at the last date of the month in
Time Intelligence Functions
Function tes>[,<filter>]) the current context.
CLOSINGBALANCEQUARTER
Time Intelligence Functions
Function
CLOSINGBALANCEYEAR
Time Intelligence Functions
Function
Returns a table that contains a column of dates, shifted
DATEADD(<dates>,<number_of_intervals
Time Intelligence Functions DATEADD Function either forward or backward in time by the specified
>,<interval>)
number of intervals from the dates in the current context.

Returns a table that contains a column of dates that


DATESBETWEEN(<dates>,<start_date>,<e
Time Intelligence Functions DATESBETWEEN Function begins with the start_date and continues until
nd_date>)
the end_date.
Returns a table that contains a column of dates that
DATESINPERIOD(<dates>,<start_date>,<
Time Intelligence Functions DATESINPERIOD Function begins with the start_date and continues for the
number_of_intervals>,<interval>)
specified number_of_intervals.
Returns a table that contains a column of the dates for
Time Intelligence Functions DATESMTD Function DATESMTD(<dates>)
the month to date, in the current context.
Time Intelligence Functions DATESQTD Function
Time Intelligence Functions DATESYTD Function
Returns the last date of the month in the current context
Time Intelligence Functions ENDOFMONTH Function ENDOFMONTH(<dates>)
for the specified column of dates.
Time Intelligence Functions ENDOFQUARTER Function
Time Intelligence Functions ENDOFYEAR Function
Returns the first date in the current context for the
Time Intelligence Functions FIRSTDATE Function FIRSTDATE(<dates>)
specified column of dates.

Returns the first value in the column, column, filtered by


Time Intelligence Functions FIRSTNONBLANK Function FIRSTNONBLANK(<column>,<expression>)
the current context, where the expression is not blank.

Returns the last date in the current context for the


Time Intelligence Functions LASTDATE Function LASTDATE(<dates>)
specified column of dates.

08/09/2021 06:46 Page 1 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns the last value in the column, column, filtered by
Time Intelligence Functions LASTNONBLANK Function LASTNONBLANK(<column>,<expression>)
the current context, where the expression is not blank.

Returns a table that contains a column of all dates from


Time Intelligence Functions NEXTDAY Function NEXTDAY(<dates>) the next day, based on the first date specified in
the dates column in the current context.
Time Intelligence Functions NEXTMONTH Function
Time Intelligence Functions NEXTQUARTER Function
Time Intelligence Functions NEXTYEAR Function
OPENINGBALANCEMONTH OPENINGBALANCEMONTH(<expression>,<da Evaluates the expression at the first date of the month in
Time Intelligence Functions
Function tes>[,<filter>]) the current context.
OPENINGBALANCEQUARTER
Time Intelligence Functions
Function
OPENINGBALANCEYEAR
Time Intelligence Functions
Function
Returns a table that contains a column of dates that
represents a period parallel to the dates in the
PARALLELPERIOD(<dates>,<number_of_in
Time Intelligence Functions PARALLELPERIOD Function specified dates column, in the current context, with the
tervals>,<interval>)
dates shifted a number of intervals either forward in time
or back in time.
Returns a table that contains a column of all dates
Time Intelligence Functions PREVIOUSDAY Function PREVIOUSDAY(<dates>) representing the day that is previous to the first date in
the dates column, in the current context.
Time Intelligence Functions PREVIOUSMONTH Function
Time Intelligence Functions PREVIOUSQUARTER Function
Time Intelligence Functions PREVIOUSYEAR Function
Returns a table that contains a column of dates shifted
SAMEPERIODLASTYEAR
Time Intelligence Functions SAMEPERIODLASTYEAR(<dates>) one year back in time from the dates in the
Function
specified dates column, in the current context.
Returns the first date of the month in the current context
Time Intelligence Functions STARTOFMONTH Function STARTOFMONTH(<dates>)
for the specified column of dates.

Time Intelligence Functions STARTOFQUARTER Function


Time Intelligence Functions STARTOFYEAR Function
TOTALMTD(<expression>,<dates>[,<filt Evaluates the value of the expression for the month to
Time Intelligence Functions TOTALMTD Function er>]) date, in the current context.
Time Intelligence Functions TOTALQTD Function
Time Intelligence Functions TOTALYTD Function
ADDMISSINGITEMS(<showAllColumn>[,
<showAllColumn>]…, <table>,
<groupingColumn>[,
<groupingColumn>]…[, filterTable]…) Adds combinations of items from multiple columns to a
ADDMISSINGITEMS(<showAllColumn>[, table if they do not already exist. The determination of
Filter Functions ADDMISSINGITEMS Function <showAllColumn>]…, <table>, which item combinations to add is based on referencing
[ROLLUPISSUBTOTAL(]<groupingColumn>[ source columns which contain all the possible values for
, <isSubtotal_columnName>][, the columns. New to 2016.
<groupingColumn>][,
<isSubtotal_columnName>]…[)], [,
filterTable]…)
Returns all the rows in a table, or all the values in a
ALL( {<table> | <column>[, column, ignoring any filters that might have been
Filter Functions ALL Function <column>[, <column>[,…]]]} ) 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
Filter Functions ALLEXCEPT Function [,…]]) have been applied to the specified columns.
From the parent table of a relationship, returns all rows
but the blank row, or all distinct values of a column but
Filter Functions ALLNOBLANKROW Function ALLNOBLANKROW(<table>|<column>)
the blank row, and disregards any context filters that
might exist.
Removes context filters from columns and rows in the
ALLSELECTED([<tableName> |
Filter Functions ALLSELECTED Function current query, while retaining all other context filters or
<columnName>])
explicit filters.
CALCULATE(<expression>,<filter1>,<fi Evaluates an expression in a context that is modified by
Filter Functions CALCULATE Function lter2>…) the specified filters.
CALCULATETABLE(<expression>,<filter1 Evaluates a table expression in a context modified by the
Filter Functions CALCULATETABLE Function >,<filter2>,…) given filters.
Specifies the cross-filtering direction to be used in a
CROSSFILTER(<columnName1>,
Filter Functions CROSSFILTER Function calculation for a relationship that exists between two
<columnName2>, <direction>)
columns.
Returns a one-column table that contains the distinct
values from the specified column. In other words,
Filter Functions DISTINCT Function DISTINCT(<column>)
duplicate values are removed and only unique values are
returned.
Returns the current value of the specified column in an
Filter Functions EARLIER Function EARLIER(<column>, <number>)
outer evaluation pass of the mentioned column.
Returns the current value of the specified column in an
Filter Functions EARLIEST Function EARLIEST(<column>)
outer evaluation pass of the specified column.

08/09/2021 06:46 Page 2 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns a table that represents a subset of another table
Filter Functions FILTER Function FILTER(<table>,<filter>)
or expression.
Returns the values that are directly applied as filters
Filter Functions FILTERS Function FILTERS(<columnName>)
to columnName.

Returns TRUE when the number of directly filtered values


Filter Functions HASONEFILTER Function HASONEFILTER(<columnName>)
on columnName is one; otherwise returns FALSE.

Returns TRUE when the context for columnName has


Filter Functions HASONEVALUE Function HASONEVALUE(<columnName>) been filtered down to one distinct value only. Otherwise
is FALSE.
Returns TRUE when columnName or another column in
Filter Functions ISCROSSFILTERED Function ISCROSSFILTERED(<columnName>)
the same or related table is being filtered.
Returns TRUE when columnName is being filtered
directly. If there is no filter on the column or if the
Filter Functions ISFILTERED Function ISFILTERED(<columnName>) filtering happens because a different column in the same
table or in a related table is being filtered then the
function returns FALSE.
Modifies how filters are applied while evaluating a
Filter Functions KEEPFILTERS Function KEEPFILTERS(<expression>)
CALCULATE or CALCULATETABLE function.
Filter Functions RELATED Function RELATED(<column>) Returns a related value from another table.
Evaluates a table expression in a context modified by the
Filter Functions RELATEDTABLE Function RELATEDTABLE(<tableName>)
given filters.
SUBSTITUTEWITHINDEX(<table>,
<indexColumnName>,
SUBSTITUTEWITHINDEX Returns a table which represents a left semijoin of the
Filter Functions <indexColumnsTable>,
Function [<orderBy_expression>, [<order>][, two tables supplied as arguments.
<orderBy_expression>, [<order>]]…])
Specifies the relationship to be used in a specific
USERELATIONSHIP(<columnName1>,<colum
Filter Functions USERELATIONSHIP Function calculation as the one that exists between columnName1
nName2>)
and columnName2. New to 2016.
Returns a one-column table that contains the distinct
values from the specified table or column. In other
Filter Functions VALUES Function VALUES(<TableNameOrColumnName>)
words, duplicate values are removed and only unique
values are returned.
Returns true if values for all referred columns exist, or are
CONTAINS(<table>, <columnName>,
Information Functions CONTAINS Function contained, in those columns; otherwise, the function
<value>[, <columnName>, <value>]…)
returns false.
Returns the content of the CustomData property in the
Information Functions CUSTOMDATA Function CUSTOMDATA()
connection string.
Checks whether a value is blank, and returns TRUE or
Information Functions ISBLANK Function ISBLANK(<value>)
FALSE.
Checks whether a value is an error, and returns TRUE or
Information Functions ISERROR Function ISERROR(<value>)
FALSE.
Returns TRUE if number is even, or FALSE if number is
Information Functions ISEVEN Function ISEVEN(number)
odd.
Checks whether a value is a logical value, (TRUE or
Information Functions ISLOGICAL Function ISLOGICAL(<value>)
FALSE), and returns TRUE or FALSE.
Checks if a value is not text (blank cells are not text), and
Information Functions ISNONTEXT Function ISNONTEXT(<value>)
returns TRUE or FALSE.
Checks whether a value is a number, and returns TRUE or
Information Functions ISNUMBER Function ISNUMBER(<value>)
FALSE.
ISONORAFTER(<scalar_expression>,
<scalar_expression>sort_order] A boolean function that emulates the behavior of a ‘Start
Information Functions ISONORAFTER Function [,scalar_expression>, At’ clause and returns true for a row that meets all of the
<scalar_expression>, condition parameters. New for 2016.
[sort_order][,…])
Information Functions ISTEXT Function ISTEXT(<value>) Checks if a value is text, and returns TRUE or FALSE.
LOOKUPVALUE( <result_columnName>,
<search_columnName>, Returns the value in result_columnName for the row that
Information Functions LOOKUPVALUE Function <search_value>[, meets all criteria specified
<search_columnName>, by search_columnName and search_value.
<search_value>]…)
Returns the domain name and username from the
Information Functions USERNAME Function USERNAME()
credentials given to the system at connection time
Checks whether both arguments are TRUE, and returns
Logical Functions AND Function AND(<logical1>,<logical2>) TRUE if both arguments are TRUE. Otherwise returns
false.
Logical Functions FALSE Function FALSE() Returns the logical value FALSE.
Checks if a condition provided as the first argument is
IF(logical_test>,<value_if_true>,
Logical Functions IF Function met. Returns one value if the condition is TRUE, and
value_if_false)
returns another value if the condition is FALSE.
Evaluates an expression and returns a specified value if
Logical Functions IFERROR Function IFERROR(value, value_if_error) the expression returns an error; otherwise returns the
value of the expression itself.
Logical Functions NOT Function NOT(<logical>) Changes FALSE to TRUE, or TRUE to FALSE.
Checks whether one of the arguments is TRUE to return
Logical Functions OR Function OR(<logical1>,<logical2>) TRUE. The function returns FALSE if both arguments are
FALSE.
SWITCH(<expression>, <value>,
Evaluates an expression against a list of values and
Logical Functions SWITCH Function <result>[, <value>, <result>]…[,
<else>]) returns one of multiple possible result expressions.

08/09/2021 06:46 Page 3 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Logical Functions TRUE Function TRUE() Returns the logical value TRUE.
Math and Trig Functions ABS Function ABS(<number>) Returns the absolute value of a number.
Returns the arccosine, or inverse cosine, of a number.
The arccosine is the angle whose cosine is number. The
Math and Trig Functions ACOS Function ACOS(number)
returned angle is given in radians in the range 0 (zero) to
pi.
Math and Trig Functions ACOSH Function
Math and Trig Functions ASIN Function
Math and Trig Functions ASINH Function
Math and Trig Functions ATAN Function
Math and Trig Functions ATANH Function
Rounds a number up, to the nearest integer or to the
Math and Trig Functions CEILING Function CEILING(<number>, <significance>)
nearest multiple of significance.

Returns the number of combinations for a given number


Math and Trig Functions COMBIN Function COMBIN(number, number_chosen) of items. Use COMBIN to determine the total possible
number of groups for a given number of items.

Returns the number of combinations (with repetitions)


Math and Trig Functions COMBINA Function COMBINA(number, number_chosen)
for a given number of items.
Math and Trig Functions COS Function
Math and Trig Functions COSH Function
Evaluates the argument and returns the result as
Math and Trig Functions CURRENCY Function CURRENCY(<value>)
currency data type.
Math and Trig Functions DEGREES Function DEGREES(angle) Converts radians into degrees.
DIVIDE(<numerator>, <denominator> Performs division and returns alternate result or BLANK()
Math and Trig Functions DIVIDE Function [,<alternateresult>]) on division by 0.
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
Math and Trig Functions EVEN Function EVEN(number)
or two items. The crate is full when the number of items,
rounded up to the nearest two, matches the crate's
capacity.
Returns e raised to the power of a given number. The
Math and Trig Functions EXP Function EXP(<number>) constant e equals 2.71828182845904, the base of the
natural logarithm.
Returns the factorial of a number, equal to the series
Math and Trig Functions FACT Function FACT(<number>)
1*2*3*...* , ending in the given number.
Rounds a number down, toward zero, to the nearest
Math and Trig Functions FLOOR Function FLOOR(<number>, <significance>)
multiple of significance.
Returns the greatest common divisor of two or more
integers. The greatest common divisor is the largest
Math and Trig Functions GCD Function GCD(number1, [number2], ...)
integer that divides both number1 and number2 without
a remainder.
Math and Trig Functions INT Function INT(<number>) Rounds a number down to the nearest integer.
ISO.CEILING(<number>[, Rounds a number up, to the nearest integer or to the
Math and Trig Functions ISO.CEILING Function <significance>]) nearest multiple of significance.
Returns the least common multiple of integers. The least
common multiple is the smallest positive integer that is a
Math and Trig Functions LCM Function LCM(number1, [number2], ...) multiple of all integer arguments number1, number2,
and so on. Use LCM to add fractions with different
denominators.
Returns the natural logarithm of a number. Natural
Math and Trig Functions LN Function LN(<number>) logarithms are based on the constant e
(2.71828182845904).
Returns the logarithm of a number to the base you
Math and Trig Functions LOG Function LOG(<number>,<base>)
specify.
Math and Trig Functions LOG10 Function LOG10(<number>) Returns the base-10 logarithm of a number.
Returns the remainder after a number is divided by a
Math and Trig Functions MOD Function MOD(<number>, <divisor>) divisor. The result always has the same sign as the
divisor.
Math and Trig Functions MROUND Function MROUND(<number>, <multiple>) Returns a number rounded to the desired multiple.

Math and Trig Functions ODD Function ODD(number) Returns number rounded up to the nearest odd integer.

Returns the value of Pi, 3.14159265358979, accurate to


Math and Trig Functions PI Function PI()
15 digits.
Math and Trig Functions POWER Function POWER(<number>, <power>) Returns the result of a number raised to a power.
Returns the product of the numbers in a column. New in
Math and Trig Functions PRODUCT Function PRODUCT(<column>)
2016.
Returns the product of an expression evaluated for each
Math and Trig Functions PRODUCTX Function PRODUCTX(<table>, <expression>)
row in a table. New in 2016.
Performs division and returns only the integer portion of
Math and Trig Functions QUOTIENT Function QUOTIENT(<numerator>, <denominator>) the division result. Use this function when you want to
discard the remainder of division.
Math and Trig Functions RADIANS Function RADIANS(angle) Converts degrees to radians.
Returns a random number greater than or equal to 0 and
less than 1, evenly distributed. The number that is
Math and Trig Functions RAND Function RAND()
returned changes each time the cell containing this
function is recalculated.

08/09/2021 06:46 Page 4 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns a random number in the range between two
Math and Trig Functions RANDBETWEEN Function RANDBETWEEN(<bottom>,<top>)
numbers you specify.
Math and Trig Functions ROUND Function ROUND(<number>, <num_digits>) Rounds a number to the specified number of digits.
Math and Trig Functions ROUNDDOWN Function ROUNDDOWN(<number>, <num_digits>) Rounds a number down, toward zero.
Math and Trig Functions ROUNDUP Function ROUNDUP(<number>, <num_digits>) Rounds a number up, away from 0 (zero).
Determines the sign of a number, the result of a
calculation, or a value in a column. The function returns 1
Math and Trig Functions SIGN Function SIGN(<number>)
if the number is positive, 0 (zero) if the number is zero, or
-1 if the number is negative.
Math and Trig Functions SQRT Function SQRT(<number>) Returns the square root of a number.
Math and Trig Functions SUM Function SUM(<column>) Adds all the numbers in a column.
Returns the sum of an expression evaluated for each row
Math and Trig Functions SUMX Function SUMX(<table>, <expression>)
in a table.
Truncates a number to an integer by removing the
Math and Trig Functions TRUNC Function TRUNC(<number>,<num_digits>)
decimal, or fractional, part of the number.
EXCEPT(<table_expression1>, Returns the rows of one table which do not appear in
Other functions EXCEPT Function <table_expression2> another table.
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 (<table>,
GROUPBY permits a new function, CURRENTGROUP(), to
Other functions GROUPBY Function [<groupBy_columnName1>], [<name>,
<expression>]… ) 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.
New in 2016.
INTERSECT(<table_expression1>, Returns the row intersection of two tables, retaining
Other functions INTERSECT Function <table_expression2>) duplicates.
Other functions ISEMPTY Function ISEMPTY(<table_expression>) Checks if a table is empty. New in 2016.
Performs an inner join of a table with another table. The
NATURALINNERJOIN(<leftJoinTable>, tables are joined on common columns (by name) in the
Other functions NATURALINNERJOIN Function <rightJoinTable>)
two tables. If the two tables have no common column
names, an error is returned. New in 2016.

Performs a left outer join of a table with another table.


NATURALLEFTOUTERJOIN NATURALLEFTOUTERJOIN(<leftJoinTable> The tables are joined on common columns (by name) in
Other functions
Function , <rightJoinTable>) the two tables. If the two tables have no common
column names, an error is returned. New in 2016.
SUMMARIZECOLUMNS(
<groupBy_columnName> [, <
SUMMARIZECOLUMNS Returns a summary table over a set of groups. New in
Other functions groupBy_columnName >]…,
Function [<filterTable>]…[, <name>, 2016.
<expression>]…)
UNION(<table_expression1>,
Creates a union (join) table from a pair of tables. New in
Other functions UNION Function <table_expression2>
[,<table_expression>]…) 2016.
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
Other functions VAR VAR <name> = <expression>
calculated for a variable expression, those values do not
change, even if the variable is referenced in another
expression. New in 2016.
Returns a delimited text string with the identifiers of all
PATH(<ID_columnName>,
Parent and Child Functions PATH Function the parents of the current identifier, starting with the
<parent_columnName>)
oldest and continuing until current.
Returns TRUE if the specified item exists within the
Parent and Child Functions PATHCONTAINS Function PATHCONTAINS(<path>, <item>)
specified path.
Returns the item at the specified position from a string
PATHITEM(<path>, <position>[,
Parent and Child Functions PATHITEM Function resulting from evaluation of a PATH function. Positions
<type>])
are counted from left to right.
Returns the item at the specified position from a string
PATHITEMREVERSE(<path>, <position>[,
Parent and Child Functions PATHITEMREVERSE Function resulting from evaluation of a PATH function. Positions
<type>])
are counted backwards from right to left.
Returns the number of parents to the specified item in a
Parent and Child Functions PATHLENGTH Function PATHLENGTH(<path>)
given PATH result, including self.
ADDCOLUMNS(<table>, <name>,
Adds calculated columns to the given table or table
Statistical Functions ADDCOLUMNS Function <expression>[, <name>,
<expression>]…) expression.
Returns the average (arithmetic mean) of all the numbers
Statistical Functions AVERAGE Function AVERAGE(<column>)
in a column.
Returns the average (arithmetic mean) of the values in a
Statistical Functions AVERAGEA Function AVERAGEA(<column>)
column. Handles text and non-numeric values.
Calculates the average (arithmetic mean) of a set of
Statistical Functions AVERAGEX Function AVERAGEX(<table>,<expression>)
expressions evaluated over a table.
Returns the beta distribution. The beta distribution is
BETA.DIST(x,alpha,beta,cumulative,[A commonly used to study variation in the percentage of
Statistical Functions BETA.DIST Function ],[B]) something across samples, such as the fraction of the
day people spend watching television.
BETA.INV(probability,alpha,beta,[A], Returns the inverse of the beta cumulative probability
Statistical Functions BETA.INV Function [B]) density function (BETA.DIST).

08/09/2021 06:46 Page 5 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns the inverse of the left-tailed probability of the
Statistical Functions CHISQ.INV Function CHISQ.INV(probability,deg_freedom)
chi-squared distribution.
CHISQ.INV.RT(probability,deg_freedom Returns the inverse of the right-tailed probability of the
Statistical Functions CHISQ.INV.RT Function ) chi-squared distribution.
The confidence interval is a range of values. Your sample
CONFIDENCE.NORM(alpha,standard_dev,s
Statistical Functions CONFIDENCE.NORM Function ize) mean, x, is at the center of this range and the range is x
± CONFIDENCE.NORM.
CONFIDENCE.T(alpha,standard_dev,size Returns the confidence interval for a population mean,
Statistical Functions CONFIDENCE.T Function ) using a Student's t distribution.
The COUNT function counts the number of cells in a
Statistical Functions COUNT Function COUNT(<column>)
column that contain numbers.

The COUNTA function counts the number of cells in a


column that are not empty. It counts not just rows that
Statistical Functions COUNTA Function COUNTA(<column>)
contain numeric values, but also rows that contain
nonblank values, including text, dates, and logical values.

The COUNTAX function counts nonblank results when


evaluating the result of an expression over a table. That
Statistical Functions COUNTAX Function COUNTAX(<table>,<expression>) 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.

Statistical Functions COUNTBLANK Function COUNTBLANK(<column>) Counts the number of blank cells in a column.
The COUNTROWS function counts the number of rows in
Statistical Functions COUNTROWS Function COUNTROWS(<table>) the specified table, or in a table defined by an
expression.
Counts the number of rows that contain a number or an
Statistical Functions COUNTX Function COUNTX(<table>,<expression>) expression that evaluates to a number, when evaluating
an expression over a table.

Returns a table that contains the Cartesian product of all


CROSSJOIN(<table>, <table>[,
Statistical Functions CROSSJOIN Function rows from all tables in the arguments. The columns in the
<table>]…)
new table are all the columns in all the argument tables.
DATATABLE (ColumnName1, DataType1,
ColumnName2, DataType2..., {{Value1, Provides a mechanism for declaring an inline set of data
Statistical Functions DATATABLE Function Value2...}, {ValueN, values. New to 2016.
ValueN+1...}...})
The DISTINCTCOUNT function counts the number of
Statistical Functions DISTINCTCOUNT Function DISTINCTCOUNT(<column>)
different cells in a column of numbers.
Returns the exponential distribution. Use EXPON.DIST to
model the time between events, such as how long an
Statistical Functions EXPON.DIST Function EXPON.DIST(x,lambda,cumulative) 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.
Returns a table with the Cartesian product between each
row in table1 and the table that results from
Statistical Functions GENERATE Function GENERATE(<table1>, <table2>)
evaluating table2 in the context of the current row
from table1.
Returns a table with the Cartesian product between each
row in table1 and the table that results from
Statistical Functions GENERATEALL Function GENERATEALL(<table1>, <table2>)
evaluating table2 in the context of the current row
from table1.
Returns the geometric mean of the numbers in a column.
Statistical Functions GEOMEAN Function GEOMEAN(<column>)
New in 2016.
Returns the geometric mean of an expression evaluated
Statistical Functions GEOMEANX Function GEOMEANX(<table>, <expression>)
for each row in a table. New in 2016.
Statistical Functions MAX Function MAX(<column>) Returns the largest numeric value in a column.
Returns the largest value in a column. Logical values and
Statistical Functions MAXA Function MAXA(<column>)
blanks are counted.
Evaluates an expression for each row of a table and
Statistical Functions MAXX Function MAXX(<table>,<expression>)
returns the largest numeric value.
Returns the median of numbers in a column. New to
Statistical Functions MEDIAN Function MEDIAN(<column>)
2016.
Returns the median number of an expression evaluated
Statistical Functions MEDIANX Function MEDIANX(<table>, <expression>)
for each row in a table. New to 2016.
Returns the smallest numeric value in a column. Ignores
Statistical Functions MIN Function MIN(<column>)
logical values and text.
Returns the smallest value in a column, including any
Statistical Functions MINA Function MINA(<column>)
logical values and numbers represented as text.
Returns the smallest numeric value that results from
Statistical Functions MINX Function MINX(<table>, < expression>)
evaluating an expression for each row of a table.
Returns the k-th percentile of values in a range, where k
Statistical Functions PERCENTILE.EXC Function PERCENTILE.EXC(<column>, <k>)
is in the range 0..1, exclusive. New to 2016.
Returns the k-th percentile of values in a range, where k
Statistical Functions PERCENTILE.INC Function PERCENTILE.INC(<column>, <k>)
is in the range 0..1, inclusive. New to 2016.
PERCENTILEX.EXC(<table>, Returns the percentile number of an expression
Statistical Functions PERCENTILEX.EXC Function <expression>, k) evaluated for each row in a table. New to 2016.
PERCENTILEX.INC(<table>, Returns the percentile number of an expression
Statistical Functions PERCENTILEX.INC Function <expression>;, k) evaluated for each row in a table. New to 2016.

08/09/2021 06:46 Page 6 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns the Poisson distribution. A common application
of the Poisson distribution is predicting the number of
Statistical Functions POISSON.DIST Function POISSON.DIST(x,mean,cumulative)
events over a specific time, such as the number of cars
arriving at a toll plaza in 1 minute.
RANK.EQ(<value>, <columnName>[,
Statistical Functions RANK.EQ Function Returns the ranking of a number in a list of numbers.
<order>])
RANKX(<table>, <expression>[, Returns the ranking of a number in a list of numbers for
Statistical Functions RANKX Function <value>[, <order>[, <ties>]]]) each row in the table argument.

ROW(<name>, <expression>[[,<name>, Returns a table with a single row containing values that
Statistical Functions ROW Function <expression>]…]) result from the expressions given to each column.
SAMPLE(<n_value>, <table>,
Statistical Functions SAMPLE Function <orderBy_expression>, [<order>[, Returns a sample of N rows from the specified table.
<orderBy_expression>, [<order>]]…])
SELECTCOLUMNS(<table>, <name>,
Adds calculated columns to the given table or table
Statistical Functions SELECTCOLUMNS Function <scalar_expression> [, <name>,
<scalar_expression>]…) expression.
Statistical Functions SIN Function SIN(number) Returns the sine of the given angle.
Statistical Functions SINH Function SINH(number) Returns the hyperbolic sine of a number.

Statistical Functions STDEV.P Function STDEV.P(<ColumnName>) Returns the standard deviation of the entire population.

Statistical Functions STDEV.S Function STDEV.S(<ColumnName>) Returns the standard deviation of a sample population.

Statistical Functions STDEVX.P Function STDEVX.P(<table>, <expression>) Returns the standard deviation of the entire population.

Statistical Functions STDEVX.S Function STDEVX.S(<table>, <expression>) Returns the standard deviation of a sample population.

Statistical Functions SQRTPI Function SQRTPI(number) Returns the square root of (number * pi).
SUMMARIZE(<table>,
<groupBy_columnName>[, Returns a summary table for the requested totals over a
Statistical Functions SUMMARIZE Function <groupBy_columnName>]…[, <name>, set of groups.
<expression>]…)
Statistical Functions TAN Function TAN(number) Returns the tangent of the given angle.
Statistical Functions TANH Function TANH(number) Returns the hyperbolic tangent of a number.
TOPN(<n_value>, <table>,
Statistical Functions TOPN Function <orderBy_expression>, [<order>[, Returns the top N rows of the specified table.
<orderBy_expression>, [<order>]]…])
Statistical Functions VAR.P Function VAR.P(<columnName>) Returns the variance of the entire population.
Statistical Functions VAR.S Function VAR.S(<columnName>) Returns the variance of a sample population.
Statistical Functions VARX.P Function VARX.P(<table>, <expression>) Returns the variance of the entire population.
Statistical Functions VARX.S Function VARX.S(<table>, <expression>) Returns the variance of a sample population.

XIRR(<table>, <values>, <dates>, Returns the internal rate of return for a schedule of cash
Statistical Functions XIRR Function [guess]) flows that is not necessarily periodic. New to 2016.

XNPV(<table>, <values>, <dates>, Returns the present value for a schedule of cash flows
Statistical Functions XNPV Function <rate>) that is not necessarily periodic. New to 2016.
Text functions BLANK Function BLANK() Returns a blank.
Returns a numeric code for the first character in a text
Text functions CODE Function CODE(text) string. The returned code corresponds to the character
set used by your computer.
Text functions CONCATENATE Function CONCATENATE(<text1>, <text2>) Joins two text strings into one text string.
CONCATENATEX(<table>, <expression>, Concatenates the result of an expression evaluated for
Text functions CONCATENATEX Function [delimiter]) each row in a table. New to 2016.

Compares two text strings and returns TRUE if they are


exactly the same, FALSE otherwise. EXACT is case-
Text functions EXACT Function EXACT(<text1>,<text2>)
sensitive but ignores formatting differences. You can use
EXACT to test text being entered into a document.

FIND(<find_text>, <within_text>[, Returns the starting position of one text string within
Text functions FIND Function [<start_num>][, <NotFoundValue>]]) another text string. FIND is case-sensitive.

Rounds a number to the specified number of decimals


FIXED(<number>, <decimals>,
Text functions FIXED Function and returns the result as text. You can specify that the
<no_commas>)
result be returned with or without commas.

Converts a value to text according to the specified


Text functions FORMAT Function FORMAT(<value>, <format_string>)
format.

Pre-Defined Numeric Formats


Text functions
for the FORMAT Function
Custom Numeric Formats for
Text functions
the FORMAT Function
Pre-defined Date and Time
Text functions formats for the FORMAT
Function
Custom Date and Time
Text functions formats for the FORMAT
Function

08/09/2021 06:46 Page 7 of 8


DAX Functions

DAX Functions

Category Function Syntax Description


Returns the specified number of characters from the start
Text functions LEFT Function LEFT(<text>, <num_chars>)
of a text string.
Text functions LEN Function LEN(<text>) Returns the number of characters in a text string.
Text functions LOWER Function LOWER(<text>) Converts all letters in a text string to lowercase.
MID(<text>, <start_num>, Returns a string of characters from the middle of a text
Text functions MID Function <num_chars>) string, given a starting position and length.
REPLACE replaces part of a text string, based on the
REPLACE(<old_text>, <start_num>,
Text functions REPLACE Function number of characters you specify, with a different text
<num_chars>, <new_text>)
string.
Repeats text a given number of times. Use REPT to fill a
Text functions REPT Function REPT(<text>, <num_times>)
cell with a number of instances of a text string.

RIGHT returns the last character or characters in a text


Text functions RIGHT Function RIGHT(<text>, <num_chars>)
string, based on the number of characters you specify.

Returns the number of the character at which a specific


SEARCH(<find_text>, <within_text>[,
Text functions SEARCH Function character or text string is first found, reading left to right.
[<start_num>][, <NotFoundValue>]])
Search is case-insensitive and accent sensitive.
SUBSTITUTE(<text>, <old_text>,
Text functions SUBSTITUTE Function Replaces existing text with new text in a text string.
<new_text>, <instance_num>)
Removes all spaces from text except for single spaces
Text functions TRIM Function TRIM(<text>)
between words.
Text functions UPPER Function UPPER (<text>) Converts a text string to all uppercase letters
Converts a text string that represents a number to a
Text functions VALUE Function VALUE(<text>)
number.

08/09/2021 06:46 Page 8 of 8

You might also like