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
| DAX | Excel | Match |
|---|---|---|
| SUM | SUM | |
| AVERAGE | AVERAGE | |
| MIN, MAX | MIN, MAX | |
| MEDIAN | MEDIAN | |
| COUNT | COUNT | |
| COUNTA | COUNTA | |
| COUNTBLANK | COUNTBLANK | , DAX returns a blank, not 0, when nothing is blank |
| COUNTROWS | ROWS, or COUNTIFS with a condition | |
| DISTINCTCOUNT | COUNTA(UNIQUE(…)) | |
| DISTINCTCOUNTNOBLANK | COUNTA(UNIQUE(FILTER(…,…<>""))) | |
| SUMX | SUMPRODUCT, or SUM(E2:E13*F2:F13) | |
| AVERAGEX, MINX, MAXX, COUNTX | AVERAGE, MIN, MAX or COUNT of a calculation on ranges | |
| CONCATENATEX | TEXTJOIN, with SORT for the order | |
| RANKX, RANK | RANK.EQ | , DAX ranks within the context of the visual |
Visual calculations
| DAX | Excel | Match |
|---|---|---|
| RUNNINGSUM | SUM($G$2:G2), copied down | |
| MOVINGAVERAGE | AVERAGE(OFFSET(…)) | |
| PREVIOUS | a reference to the row above | |
| FIRST | INDEX(range,1) | |
| OFFSET | OFFSET | |
| INDEX | INDEX | |
| WINDOW | SUM(OFFSET(…)) | |
| ROWNUMBER | ROW()-1, or SEQUENCE |
Filters and context
| DAX | Excel | Match |
|---|---|---|
| CALCULATE | SUMIFS, COUNTIFS or AVERAGEIFS, depending on the calculation | |
| FILTER | FILTER | |
| CALCULATETABLE | FILTER | |
| ALLSELECTED | SUBTOTAL, AGGREGATE (the total of the visible rows) | |
| VALUES | UNIQUE | , VALUES can add a blank row |
| DISTINCT | UNIQUE | |
| SELECTEDVALUE | IF(COUNTA(UNIQUE(…))=1,INDEX(UNIQUE(…),1),fallback) | |
| HASONEVALUE | COUNTA(UNIQUE(…))=1 |
Relationships
| DAX | Excel | Match |
|---|---|---|
| RELATED | XLOOKUP, VLOOKUP | , the relationship replaces the lookup |
| LOOKUPVALUE | XLOOKUP, or INDEX and MATCH | |
| RELATEDTABLE | FILTER(Sales,Sales!C:C=C2) |
Building a table
| DAX | Excel | Match |
|---|---|---|
| SUMMARIZE | GROUPBY (Microsoft 365), or a PivotTable | , SUMMARIZE alone calculates nothing |
| SUMMARIZECOLUMNS | GROUPBY (Microsoft 365), or a PivotTable | |
| SELECTCOLUMNS | CHOOSECOLS | |
| ADDCOLUMNS | HSTACK(table,calculation) | |
| UNION | VSTACK | |
| TOPN | TAKE(SORT(…),N) | , TOPN keeps ties |
| INTERSECT, EXCEPT | FILTER(…,COUNTIF(…)>0), FILTER(…,COUNTIF(…)=0) | |
| GENERATESERIES | SEQUENCE | |
| DATATABLE | an array constant {…} |
Logic
| DAX | Excel | Match |
|---|---|---|
| IF | IF | |
| SWITCH | SWITCH, and SWITCH( TRUE() ) close to IFS | |
| AND, OR, NOT | AND, OR, NOT | |
| IFERROR | IFERROR | |
| ISBLANK | ISBLANK | , in DAX, blank is not "" |
| BLANK | "" | |
| COALESCE | IF(ISBLANK(a),b,a) | |
| DIVIDE | IFERROR(a/b,fallback) |
Math and text
| DAX | Excel | Match |
|---|---|---|
| ROUND, ROUNDUP, ROUNDDOWN | ROUND, ROUNDUP, ROUNDDOWN | |
| INT, ABS, MOD | INT, ABS, MOD | |
| CONCATENATE | CONCATENATE, CONCAT, or & | , only two arguments in DAX |
| FORMAT | TEXT | , with the same pattern letters, like “yyyy” |
| LEFT, RIGHT, MID, LEN | LEFT, RIGHT, MID, LEN | |
| UPPER, LOWER, TRIM | UPPER, LOWER, TRIM | |
| SUBSTITUTE, SEARCH, VALUE | SUBSTITUTE, SEARCH, VALUE | |
| CONTAINSSTRING | ISNUMBER(SEARCH(…)) |
Dates
| DAX | Excel | Match |
|---|---|---|
| DATE, YEAR, MONTH, DAY | DATE, YEAR, MONTH, DAY | |
| TODAY, NOW | TODAY, NOW | |
| EOMONTH, EDATE | EOMONTH, EDATE | |
| WEEKDAY, WEEKNUM, NETWORKDAYS | WEEKDAY, WEEKNUM, NETWORKDAYS | |
| DATEDIFF | DATEDIF | , different order and units |
| QUARTER | ROUNDUP(MONTH(d)/3,0) | |
| CALENDAR | SEQUENCE(end-start+1,1,start) | |
| CALENDARAUTO | SEQUENCE, with MIN and MAX of the dates | , CALENDARAUTO takes whole years |
| FIRSTDATE, LASTDATE | MIN, MAX of the dates |
Time functions
| DAX | Excel | Match |
|---|---|---|
| DATESYTD, TOTALYTD | SUMIFS(amounts,dates,">="&DATE(YEAR(d),1,1),dates,"<="&d) | |
| DATESQTD, TOTALQTD, DATESMTD, TOTALMTD | the same formula, from the start of the quarter or month | |
| SAMEPERIODLASTYEAR | SUMIFS with EDATE(…,-12) | |
| DATEADD | EDATE | , shifts a date, not a period |
| PARALLELPERIOD, PREVIOUSMONTH, PREVIOUSQUARTER, PREVIOUSYEAR, NEXTMONTH, NEXTQUARTER, NEXTYEAR | SUMIFS between the two bounds of the period (EOMONTH…) | |
| DATESBETWEEN, DATESINPERIOD | SUMIFS(…,">="&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.