DAX Functions
DAX Functions
Function Description
CALENDAR(, ) Generates a column of continuous sets of dates, inclusive of the specified dates.
CALENDARAUTO([fiscal_year_end_month]) Generates a column of continuous sets of dates, automatically based on data in model.
DATEDIFF(, , ) Returns the count of interval boundaries crossed between two dates.
EDATE(, ) Returns the date that is the indicated number of months before or after the start date.
EOMONTH(, ) Returns date in the datetime format of the last day of the month, before or after a specified
number of months.
HOUR() Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.). The generated text
value is automatically parsed and converted to a date/time value.
MINUTE() Returns the minute as a number from 0 to 59, given a date and time value.
MONTH() Returns the month as a number from 1 (January) to 12 (December).
QUARTER() Returns the quarter as a number from 1 (January – March) to 4 (October – December).
TIME(hour, minute, second) Converts hours, minutes, and seconds given as numbers to a time in datetime format.
WEEKDAY(, ) Returns a number from 1 to 7 identifying the day of the week of a date. By default week
starts on Sunday(1) and ends on Saturday(7).
WEEKNUM(, ) 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. By default week
begins on Sunday(1).
YEAR() Returns the year of a date as a four digit integer in the range 1900-9999.
YEARFRAC(, , ) Calculates the fraction of the year represented by the number of whole days between two
dates.
Filter Function
Function Description
ALL( [ | [, [, [,…]]]] ) Returns all the rows in a table, or all the values in a column, ignoring any fil
been applied.
ALLEXCEPT( ,[,[,…]]) Removes all context filters in the table except filters that have been applied t
columns.
ALLNOBLANKROW( { | [, [, [,…]]]} ) From the parent table of a relationship, returns all rows but the blank row, or
a column but the blank row, and disregards any context filters that might exi
ALLSELECTED([ | [ [, [,…]]]] ) The ALLSELECTED function gets the context that represents all rows and c
while keeping explicit filters and contexts other than row and column filters.
CALCULATETABLE([, [, [, …]]]) Evaluates a table expression in a modified filter context. Filters are optional
expression, table filter expressions and filter modifier functions.
EARLIER(, ) Returns the current value of the specified column in an outer evaluation pass
column.
EARLIEST() Returns the current value of the specified column in an outer evaluation pass
column.
KEEPFILTERS() Modifies how filters are applied while evaluating a CALCULATE or CALC
function.
LOOKUPVALUE( , , [, , ]… [, ] ) Returns the value for the row that meets all criteria specified by one or more
there’s no match that satisfies all the search values, BLANK or alternateRes
returned. In other words, the function won’t return a lookup value if only som
match. If multiple rows match the search values and in all cases the result_co
identical, then that value is returned. However, if result_column returns diffe
or alternateResult (if supplied) is returned.
SELECTEDVALUE([, ]) Returns the value when the context for columnName has been filtered down
only. Otherwise returns alternateResult.
Logical Functions
Function Description
COALESCE(, [, ]…) Returns the first expression that does not evaluate to BLANK. If all expressions evaluate to B
returned.
IFERROR(value, value_if_error) Evaluates an expression and returns a specified value if the expression returns an error; otherw
of the expression itself.
SWITCH(, , [, , ]…[, ]) Evaluates an expression against a list of values and returns one of multiple possible result exp
Financial Functions
Functions Description
ACCRINT(, , , , , [, [, ]]) Returns the accrued interest for a security that pays periodic interest.
ACCRINTM(, , , [, ]) Returns the accrued interest for a security that pays interest at maturity.
AMORDEGRC(, , , , , [, ]) Returns the depreciation for each accounting period. If an asset is purcha
the accounting period, the prorated depreciation is taken into account. Th
to AMORLINC, except that a depreciation coefficient is applied in the c
on the life of the assets.
AMORLINC(, , , , , [, ]) Returns the depreciation for each accounting period. If an asset is purcha
the accounting period, the prorated depreciation is taken into account.
COUPDAYBS(, , [, ]) Returns the number of days from the beginning of a coupon period until
COUPDAYS(, , [, ]) Returns the number of days in the coupon period that contains the settlem
COUPDAYSNC(, , [, ]) Returns the number of days from the settlement date to the next coupon
COUPNCD(, , [, ]) Returns the next coupon date after the settlement date.
COUPNUM(, , [, ]) Returns the number of coupons payable between the settlement date and
rounded up to the nearest whole coupon.
COUPPCD(, , [, ]) Returns the previous coupon date before the settlement date.
CUMIPMT(, , , , , ) Returns the cumulative interest paid on a loan between start_period and
CUMPRINC(, , , , , ) Returns the cumulative principal paid on a loan between start_period and
DB(, , , [, ]) Returns the depreciation of an asset for a specified period using the fixed
method.
DDB(, , , [, ]) Returns the depreciation of an asset for a specified period using the doub
method or some other method you specify.
DOLLARDE(, ) Converts a dollar price expressed as an integer part and a fraction part, s
dollar price expressed as a decimal number.
DOLLARFR(, ) Converts a dollar price expressed as a decimal number into a dollar price
integer part and a fraction part, such as 1.02.
DURATION(, , , , [, ]) Returns the Macauley duration for an assumed par value of $100. Durati
weighted average of the present value of cash flows, and is used as a me
price’s response to changes in yield.
EFFECT(, ) Returns the effective annual interest rate, given the nominal annual inter
number of compounding periods per year.
FV(, , [, [, ]]) Calculates the future value of an investment based on a constant interest
IPMT(, , , [, [, ]]) Returns the interest payment for a given period for an investment based
payments and a constant interest rate.
ISPMT(, , , ) Calculates the interest paid (or received) for the specified period of a loa
with even principal payments.
MDURATION(, , , , [, ]) Returns the modified Macauley duration for a security with an assumed
NOMINAL(, ) Returns the nominal annual interest rate, given the effective rate and the
compounding periods per year.
NPER(, , [, [, ]]) Returns the number of periods for an investment based on periodic, cons
constant interest rate.
ODDFPRICE(, , , , , , , [, ]) Returns the price per $100 face value of a security having an odd (short
ODDFYIELD(, , , , , , , [, ]) Returns the yield of a security that has an odd (short or long) first period
ODDLPRICE(, , , , , , [, ]) Returns the price per $100 face value of a security having an odd (short
period.
ODDLYIELD(, , , , , , [, ]) Returns the yield of a security that has an odd (short or long) last period.
PMT(, , [, [, ]]) Calculates the payment for a loan based on constant payments and a con
PPMT(, , , [, [, ]]) Returns the payment on the principal for a given period for an investmen
constant payments and a constant interest rate.
PRICE(, , , , , [, ]) Returns the price per $100 face value of a security that pays periodic int
PRICEDISC(, , , [, ]) Returns the price per $100 face value of a discounted security.
PRICEMAT(, , , , [, ]) Returns the price per $100 face value of a security that pays interest at m
PV(, , [, [, ]]) Calculates the present value of a loan or an investment, based on a const
RECEIVED(, , , [, ]) Returns the amount received at maturity for a fully invested security.
TBILLPRICE(, , ) Returns the price per $100 face value for a Treasury bill.
VDB(, , , , [, [, ]]) Returns the depreciation of an asset for any period you specify, includin
using the double-declining balance method or some other method you sp
for variable declining balance.
XIRR( , , , [guess]) Returns the internal rate of return for a schedule of cash flows that is not
XNPV( , , , ) Returns the present value for a schedule of cash flows that is not necessa
YIELDMAT(, , , , [, ]) Returns the annual yield of a security that pays interest at maturity.
Information Function
Functions Description
CONTAINS( , , [, , ]…) Returns true if values for all referred columns exist, or are contained, in those columns; otherwise, the func
CONTAINSROW(, [, , …]) Returns TRUE if a row of values exists or contained in a table, otherwise returns FALSE.
CONTAINSSTRING(, ) Returns TRUE or FALSE indicating whether one string contains another string.
CONTAINSSTRINGEXACT(, ) Returns TRUE or FALSE indicating whether one string contains another string.
CUSTOMDATA() Returns the content of the CustomData property in the connection string.
HASONEFILTER() Returns TRUE when the number of directly filtered values on columnName is one; otherwise returns FALS
HASONEVALUE() Returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherw
ISCROSSFILTERED() Returns TRUE when the columnName or another column in the same or related table is being filtered.
ISFILTERED() Returns TRUE when columnName is being filtered directly. If there is no filter on the column or if the filte
a different column in the same table or in a related table is being filtered then the function returns FALSE.
ISINSCOPE() Returns true when the specified column is the level in a hierarchy of levels.
ISLOGICAL() Checks whether a value is a logical value, (TRUE or FALSE), and returns TRUE or FALSE.
ISNONTEXT() Checks if a value is not text (blank cells are not text), and returns TRUE or FALSE.
ISSELECTEDMEASURE( M1, M2, … ) Used by expressions for calculation items to determine the measure that is in context is one of those specifi
measures.
ISSUBTOTAL() Used by expressions for calculation items to determine the measure that is in context is one of those specifi
measures.
NONVISUAL() Marks a value filter in a SUMMARIZECOLUMNS expression as non-visual. This function can only be use
a SUMMARIZECOLUMNS expression.
SELECTEDMEASURE() Used by expressions for calculation items to reference the measure that is in context.
SELECTEDMEASUREFORMATSTRING() Used by expressions for calculation items to retrieve the format string of the measure that is in context.
SELECTEDMEASURENAME() Used by expressions for calculation items to determine the measure that is in context by name.
USERNAME() Returns the domain name and username from the credentials given to the system at connection time.
USEROBJECTID() Returns the current user’s Object ID from Azure AD or security identifier (SID).
Function Description
ACOT(number) Returns the principal value of the arccotangent, or inverse cotangent of a number.
ASIN(number) Returns the arcsine, or inverse sine, of a number. The returned angle is given in radians ( -π/2 to π
ATAN(number) Returns the arctangent, or inverse tangent, of a number. The returned angle is given in radians ( -
ATANH(number) Returns the inverse hyperbolic tangent of a number. Number must be between -1 and 1 (excluding
CEILING(, ) Rounds a number up, to the nearest integer or to the nearest multiple of significance.
COMBIN(number, number_chosen) Returns the number of combinations for a given number of items.
COMBINA(number, number_chosen) Returns the number of combinations (with repetitions) for a given number of items.
CURRENCY() Evaluates the argument and returns the result as currency data type.
DIVIDE(, [,]) Performs division and returns alternate result or BLANK() on division by 0.
EVEN(number) Returns number rounded up to the nearest even integer.
FLOOR(, ) Rounds a number down, toward zero, to the nearest multiple of significance.
GCD(number1, [number2], …) Returns the greatest common divisor of two or more integers.
ISO.CEILING([, ]) Rounds a number up, to the nearest integer or to the nearest multiple of significance.
PRODUCTX( , ) Returns the product of an expression evaluated for each row in a table.
QUOTIENT(, ) Performs division and returns only the integer portion of the division result.
RAND() Returns a random number greater than or equal to 0 and less than 1, evenly distributed.
RANDBETWEEN(,) Returns a random number in the range between two numbers you specify.
SIGN() Determines the sign of a number, the result of a calculation, or a value in a column. The function
number is positive, 0 (zero) if the number is zero, or -1 if the number is negative.
SUMX( , ) Returns the sum of an expression evaluated for each row in a table.
TRUNC(,) Truncates a number to an integer by removing the decimal, or fractional, part of the number.
Other Function
Functions Description
BLANK() Returns a blank.
Functions Description
PATH(, ) Returns a delimited text string with the identifiers of all the parents of the current identifier, starting w
continuing until current.
PATHCONTAINS(, ) Returns TRUE if the specified item exists within the specified path.
PATHITEM(, [, ]) Returns the item at the specified position from a string resulting from evaluation of a PATH function.
from left to right.
PATHITEMREVERSE(, [, ]) Returns the item at the specified position from a string resulting from evaluation of a PATH function.
backwards from right to left.
PATHLENGTH() Returns the number of parents to the specified item in a given PATH result, including self.
Relationship Functions
Function Description
CROSSFILTER(, , ) Specifies the cross-filtering direction to be used in a calculation for a relationship tha
columns.
USERELATIONSHIP(,) Specifies the relationship to be used in a specific calculation as the one that exists bet
and columnName2.
Statistical Functions
Function Description
APPROXIMATEDISTINCTCOUNT() Returns the approximate number of rows that contain distinct values in a column.
AVERAGE() Returns the average (arithmetic mean) of all the numbers in a column.
AVERAGEA() Returns the average (arithmetic mean) of the values in a column. Handles text and non-numeric valu
AVERAGEX() Calculates the average (arithmetic mean) of a set of expressions evaluated over a table.
BETA.INV(probability,alpha,beta,[A],[B]) Returns the inverse of the beta cumulative probability density function (BETA.DIST).
CHISQ.INV(probability,deg_freedom) Returns the inverse of the left-tailed probability of the chi-squared distribution.
CHISQ.INV.RT(probability,deg_freedom) Returns the inverse of the right-tailed probability of the chi-squared distribution.
CONFIDENCE.T(alpha,standard_dev,size) Returns the confidence interval for a population mean, using a Student’s t distribution.
COUNT() The COUNT function counts the number of cells in a column that contain non-blank values.
COUNTA() The COUNTA function counts the number of cells in a column that are not empty.
COUNTAX( ,) The function counts nonblank results when evaluating the result of an expression over a table.
COUNTROWS( ) The function counts the number of rows in the specified table, or in a table defined by an expression.
COUNTX( ,) Counts the number of rows that contain a non-blank value or an expression that evaluates to a non-bl
evaluating an expression over a table.
GEOMEANX( , ) Returns the geometric mean of an expression evaluated for each row in a table.
MAXX( ,) Evaluates an expression for each row of a table and returns the largest value.
MEDIANX( , ) Returns the median number of an expression evaluated for each row in a table.
MIN() Returns the smallest value in a column, or between two scalar expressions.
MINX( , < expression>) Returns the smallest 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.
NORM.INV(Probability, Mean, Standard_dev) The inverse of the normal cumulative distribution for the specified mean and standard deviation.
NORM.S.DIST(Z, Cumulative) Returns the standard normal distribution (has a mean of zero and a standard deviation of one).
NORM.S.INV(Probability) Returns the inverse of the standard normal cumulative distribution. The distribution has a mean of ze
deviation of one.
PERCENTILE.EXC(, ) Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.
PERCENTILE.INC(, ) Returns the k-th percentile of values in a range, where k is in the range 0..1, inclusive.
PERCENTILEX.EXC( , , k) Returns the percentile number of an expression evaluated for each row in a table.
PERCENTILEX.INC( , ;, k) Returns the percentile number of an expression evaluated for each row in a table.
PERMUT(number, number_chosen) Returns the number of permutations for a given number of objects that can be selected from number
RANKX( , [, [, [, ]]]) Returns the ranking of a number in a list of numbers for each row in the table argument.
SAMPLE(, , , [[, , []]…]) Returns a sample of N rows from the specified table.
SIN(number) Returns the sine of the given angle.
Functions Description
ADDCOLUMNS( , , [, , ]…) Adds calculated columns to the given table or table expression.
CROSSJOIN( ,[,]…) Returns a table that contains the Cartesian product of all rows from all
arguments. The columns in the new table are all the columns in all the
CURRENTGROUP ( ) Returns a set of rows from the table argument of a GROUPBY express
current row of the GROUPBY result.
DATATABLE (ColumnName1, DataType1, ColumnName2, DataType2…, {{Value1, Provides a mechanism for declaring an inline set of data values.
Value2…}, {ValueN, ValueN+1…}…})
DETAILROWS([Measure]) Evaluates a Detail Rows Expression defined for a measure and returns
DISTINCT() Returns a one-column table that contains the distinct values from the sp
DISTINCT( ) Returns a table by removing duplicate rows from another table or expre
EXCEPT(, Returns the rows of one table which do not appear in another table.
FILTERS() Returns the values that are directly applied as filters to columnName.
GENERATE(, ) Returns a table with the Cartesian product between each row in table1
results from evaluating table2 in the context of the current row from ta
GENERATEALL(, ) Returns a table with the Cartesian product between each row in table1
results from evaluating table2 in the context of the current row from ta
GROUPBY ( [, [, [, …]]] [, , [, , [, …]]]) The GROUPBY function is similar to the SUMMARIZE function. How
does not do an implicit CALCULATE for any extension columns that i
permits a new function, CURRENTGROUP, to be used inside aggrega
extension columns that it adds. GROUPBY is used to perform multiple
single table scan.
ROLLUPISSUBTOTAL ( [], , [, [] [, , [, [] [, … ] ] ] ] ) Pairs rollup groups with the column added by ROLLUPADDISSUBTO
can only be used within an ADDMISSINGITEMS expression.
ROW(, [[,, ]…]) Returns a table with a single row containing values that result from the
each column.
SELECTCOLUMNS( , , [, , ]…) Adds calculated columns to the given table or table expression.
SUMMARIZE ( , [, ]…[, , ]…) Returns a summary table for the requested totals over a set of groups.
SUMMARIZECOLUMNS( [, < groupBy_columnName >]…, []…[, , ]…) Returns a summary table over a set of groups.
TOPN(, , , [[, , []]…]) Returns the top N rows of the specified table.
TREATAS(table_expression, [, [, [,…]]]} ) Applies the result of a table expression as filters to columns from an un
VALUES() When the input parameter is a column name, returns a one-column tabl
distinct values from the specified column. Duplicate values are remove
values are returned. A BLANK value can be added. When the input pa
name, returns the rows from the specified table. Duplicate rows are pre
row can be added.
Text Functions
Function Description
COMBINEVALUES(, , [, ]…) Joins two or more text strings into one text string.
EXACT(,) Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
FIND(, [, [][, ]]) Returns the starting position of one text string within another text string. FIND is case-sensitive.
FIXED(, , ) Rounds a number to the specified number of decimals and returns the result as text.
LEFT(, ) Returns the specified number of characters from the start of a text string.
MID(, , ) Returns a string of characters from the middle of a text string, given a starting position and length.
REPLACE(, , , ) REPLACE replaces part of a text string, based on the number of characters you specify, with a differ
RIGHT(, ) RIGHT returns the last character or characters in a text string, based on the number of characters you
SEARCH(, [, [][, ]]) Returns the number of the character at which a specific character or text string is first found, reading
is case-insensitive and accent sensitive.
TRIM() Removes all spaces from text except for single spaces between words.
Functions Description
CLOSINGBALANCEMONTH(, Evaluates the expression at the last date of the month in the current context.
[,])
CLOSINGBALANCEQUARTER(, Evaluates the expression at the last date of the quarter in the current context.
[,])
CLOSINGBALANCEYEAR(,[,] Evaluates the expression at the last date of the year in the current context.
[,])
DATEADD(,,) Returns a table that contains a column of dates, shifted either forward or backward in time by the specified number of interva
from the dates in the current context.
DATESBETWEEN(, , ) Returns a table that contains a column of dates that begins with a specified start date and continues until a specified end date.
DATESINPERIOD(, , , ) Returns a table that contains a column of dates that begins with a specified start date and continues for the specified number a
type of date intervals.
DATESMTD() Returns a table that contains a column of the dates for the month to date, in the current context.
DATESQTD() Returns a table that contains a column of the dates for the quarter to date, in the current context.
DATESYTD( [,]) Returns a table that contains a column of the dates for the year to date, in the current context.
ENDOFMONTH() Returns the last date of the month in the current context for the specified column of dates.
ENDOFQUARTER() Returns the last date of the quarter in the current context for the specified column of dates.
ENDOFYEAR( [,]) Returns the last date of the year in the current context for the specified column of dates.
FIRSTDATE() Returns the first date in the current context for the specified column of dates.
FIRSTNONBLANK(,) Returns the first value in the column, filtered by the current context, where the expression is not blank.
FIRSTNONBLANKVALUE(, ) Evaluates an expression filtered by the sorted values of a column and returns the first value of the expression that is not blank
LASTDATE() Returns the last date in the current context for the specified column of dates.
LASTNONBLANK(,) Returns the last value in the column, filtered by the current context, where the expression is not blank.
LASTNONBLANKVALUE(, ) Evaluates an expression filtered by the sorted values of a column and returns the last value of the expression that is not blank
NEXTDAY() 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 t
current context.
NEXTMONTH() Returns a table that contains a column of all dates from the next month, based on the first date in the current context.
NEXTQUARTER() 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([,]) 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(, Evaluates the expression at the first date of the month in the current context.
[,])
OPENINGBALANCEQUARTER(, Evaluates the expression at the first date of the quarter, in the current context.
[,])
OPENINGBALANCEYEAR(,[,] Evaluates the expression at the first date of the year in the current context.
[,])
PARALLELPERIOD(,,) Returns a table that contains a column of dates that represents a period parallel to the dates in the specified dates column, in
current context, with the dates shifted a number of intervals either forward in time or back in time.
PREVIOUSDAY() Returns a table that contains a column of all dates representing the day that is previous to the first date in the dates column, i
the current context.
PREVIOUSMONTH() 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() Returns a table that contains a column of all dates from the previous quarter, based on the first date in the dates column, in th
current context.
PREVIOUSYEAR([,]) Returns a table that contains a column of all dates from the previous year, given the last date in the dates column, in the curre
context.
SAMEPERIODLASTYEAR() Returns a table that contains a column of dates shifted one year back in time from the dates in the specified date column, in t
current context.
STARTOFMONTH() Returns the first date of the month in the current context for the specified column of dates.
STARTOFQUARTER() Returns the first date of the quarter in the current context for the specified column of dates.
STARTOFYEAR() Returns the first date of the year in the current context for the specified column of dates.
TOTALMTD(,[,]) Evaluates the value of the expression for the month to date, in the current context.
TOTALQTD(,[,]) Evaluates the value of the expression for the dates in the quarter to date, in the current context.
TOTALYTD(,[,][,]) Evaluates the year-to-date value of the expression in the current context.