Your Excel formulas, translated into DAX

DAX functions and their Excel equivalent

Here are the DAX functions covered on izyDAX, each with its equivalent in Excel. The last column rates the match, from one to three dots.

  • , Excel gives the same result, with a single function or by combining several.
  • , Excel gives a close result, with a difference you should know.
  • , Excel only offers a similar idea.

Of the 111 functions in the table, 93 give the same result in Excel, 17 a close result, and only one, ALLSELECTED, has just a similar idea there. The 12 other functions covered on izyDAX have no equivalent in Excel, like ALL, USERELATIONSHIP or ISINSCOPE. They are not a gap. They are the heart of what DAX brings, the filter context, meaning the filters that decide which rows a calculation sees, and the relationships between tables.

Aggregating and counting
Aggregating and counting
DAXExcelMatch
SUMSUM
AVERAGEAVERAGE
MIN, MAXMIN, MAX
MEDIANMEDIAN
COUNTCOUNT
COUNTACOUNTA
COUNTBLANKCOUNTBLANK, DAX returns a blank, not 0, when nothing is blank
COUNTROWSROWS, or COUNTIFS with a condition
DISTINCTCOUNTCOUNTA(UNIQUE(…))
DISTINCTCOUNTNOBLANKCOUNTA(UNIQUE(FILTER(…,…<>"")))
SUMXSUMPRODUCT, or SUM(E2:E13*F2:F13)
AVERAGEX, MINX, MAXX, COUNTXAVERAGE, MIN, MAX or COUNT of a calculation on ranges
CONCATENATEXTEXTJOIN, with SORT for the order
RANKX, RANKRANK.EQ, DAX ranks within the context of the visual
Visual calculations
Visual calculations
DAXExcelMatch
RUNNINGSUMSUM($G$2:G2), copied down
MOVINGAVERAGEAVERAGE(OFFSET(…))
PREVIOUSa reference to the row above
FIRSTINDEX(range,1)
OFFSETOFFSET
INDEXINDEX
WINDOWSUM(OFFSET(…))
ROWNUMBERROW()-1, or SEQUENCE
Filters and context
Filters and context
DAXExcelMatch
CALCULATESUMIFS, COUNTIFS or AVERAGEIFS, depending on the calculation
FILTERFILTER
CALCULATETABLEFILTER
ALLSELECTEDSUBTOTAL, AGGREGATE (the total of the visible rows)
VALUESUNIQUE, VALUES can add a blank row
DISTINCTUNIQUE
SELECTEDVALUEIF(COUNTA(UNIQUE(…))=1,INDEX(UNIQUE(…),1),fallback)
HASONEVALUECOUNTA(UNIQUE(…))=1
Relationships
Relationships
DAXExcelMatch
RELATEDXLOOKUP, VLOOKUP, the relationship replaces the lookup
LOOKUPVALUEXLOOKUP, or INDEX and MATCH
RELATEDTABLEFILTER(Sales,Sales!C:C=C2)
Building a table
Building a table
DAXExcelMatch
SUMMARIZEGROUPBY (Microsoft 365), or a PivotTable, SUMMARIZE alone calculates nothing
SUMMARIZECOLUMNSGROUPBY (Microsoft 365), or a PivotTable
SELECTCOLUMNSCHOOSECOLS
ADDCOLUMNSHSTACK(table,calculation)
UNIONVSTACK
TOPNTAKE(SORT(…),N), TOPN keeps ties
INTERSECT, EXCEPTFILTER(…,COUNTIF(…)>0), FILTER(…,COUNTIF(…)=0)
GENERATESERIESSEQUENCE
DATATABLEan array constant {…}
Logic
Logic
DAXExcelMatch
IFIF
SWITCHSWITCH, and SWITCH( TRUE() ) close to IFS
AND, OR, NOTAND, OR, NOT
IFERRORIFERROR
ISBLANKISBLANK, in DAX, blank is not ""
BLANK""
COALESCEIF(ISBLANK(a),b,a)
DIVIDEIFERROR(a/b,fallback)
Math and text
Math and text
DAXExcelMatch
ROUND, ROUNDUP, ROUNDDOWNROUND, ROUNDUP, ROUNDDOWN
INT, ABS, MODINT, ABS, MOD
CONCATENATECONCATENATE, CONCAT, or &, only two arguments in DAX
FORMATTEXT, with the same pattern letters, like “yyyy”
LEFT, RIGHT, MID, LENLEFT, RIGHT, MID, LEN
UPPER, LOWER, TRIMUPPER, LOWER, TRIM
SUBSTITUTE, SEARCH, VALUESUBSTITUTE, SEARCH, VALUE
CONTAINSSTRINGISNUMBER(SEARCH(…))
Dates
Dates
DAXExcelMatch
DATE, YEAR, MONTH, DAYDATE, YEAR, MONTH, DAY
TODAY, NOWTODAY, NOW
EOMONTH, EDATEEOMONTH, EDATE
WEEKDAY, WEEKNUM, NETWORKDAYSWEEKDAY, WEEKNUM, NETWORKDAYS
DATEDIFFDATEDIF, different order and units
QUARTERROUNDUP(MONTH(d)/3,0)
CALENDARSEQUENCE(end-start+1,1,start)
CALENDARAUTOSEQUENCE, with MIN and MAX of the dates, CALENDARAUTO takes whole years
FIRSTDATE, LASTDATEMIN, MAX of the dates
Time functions
Time functions
DAXExcelMatch
DATESYTD, TOTALYTDSUMIFS(amounts,dates,">="&DATE(YEAR(d),1,1),dates,"<="&d)
DATESQTD, TOTALQTD, DATESMTD, TOTALMTDthe same formula, from the start of the quarter or month
SAMEPERIODLASTYEARSUMIFS with EDATE(…,-12)
DATEADDEDATE, shifts a date, not a period
PARALLELPERIOD, PREVIOUSMONTH, PREVIOUSQUARTER, PREVIOUSYEAR, NEXTMONTH, NEXTQUARTER, NEXTYEARSUMIFS between the two bounds of the period (EOMONTH…)
DATESBETWEEN, DATESINPERIODSUMIFS(…,">="&d1,…,"<="&d2)
Key takeaways

In Excel, a formula points to ranges. In DAX, a measure is written once, and the filters choose the rows it sees.