You are on page 1of 18

DAX Functions

DAX Functions

Category Function Syntax Description


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.

12/31/2023 16:34:02 Page 1 of 18Page 1 of 18 716334923.xlsx_x000D_ Classification: Public716334923.xlsx


#
measure 'Reseller Sales'[Reseller Sales Amount]=sum('Reseller Sales'[Sales Amount])
measure 'Reseller Sales'[Reseller Grand Total]=calculate(sum('Reseller Sales'[Sales Amount]), ALL('Reseller Sales'))
measure 'Reseller Sales'[Reseller Visual Total]=calculate(sum('Reseller Sales'[Sales Amount]), ALLSELECTED())
measure 'Reseller Sales'[Reseller Visual Total for All of Calendar Year]=calculate(sum('Reseller Sales'[Sales Amount]), ALLSE
measure 'Reseller Sales'[Reseller Visual Total for All of Product Category Name]=calculate(sum('Reseller Sales'[Sales Amou

[Product [Calendar
[Reseller Sales Amount] [Reseller Grand Total]
Category Name] Year]

Accessories 2000 $80,450,597


Accessories 2001 $80,450,597
Accessories 2002 $626 $80,450,597
Accessories 2003 $26,037 $80,450,597
Accessories 2004 $12,123 $80,450,597
Accessories 2005 $80,450,597
Accessories 2006 $80,450,597
Bikes 2000 $80,450,597
Bikes 2001 $80,450,597
Bikes 2002 $73,779 $80,450,597
Bikes 2003 $439,771 $80,450,597
Bikes 2004 $175,737 $80,450,597
Bikes 2005 $80,450,597
Bikes 2006 $80,450,597
Clothing 2000 $80,450,597
Clothing 2001 $80,450,597
Clothing 2002 $12,132 $80,450,597
Clothing 2003 $58,234 $80,450,597
Clothing 2004 $24,724 $80,450,597
Clothing 2005 $80,450,597
Clothing 2006 $80,450,597
Components 2000 $80,450,597
Components 2001 $80,450,597
Components 2002 $4,958 $80,450,597
Components 2003 $48,884 $80,450,597
Components 2004 $80,450,597
Components 2005 $80,450,597
Components 2006 $80,450,597

_x000D_ Classification: Public


#
ount]), ALL('Reseller Sales'))
ount]), ALLSELECTED())
eseller Sales'[Sales Amount]), ALLSELECTED('Date'[Calendar Year]))
ate(sum('Reseller Sales'[Sales Amount]), ALLSELECTED('Product Category'[Product Category Name]))
[Reseller Visual Total for
[Reseller Visual Total for
[Reseller Visual Total] All of Product Category
All of Calendar Year]
Name]
$877,007 $38,786
$877,007 $38,786
$877,007 $38,786 $91,495
$877,007 $38,786 $572,927
$877,007 $38,786 $212,584
$877,007 $38,786
$877,007 $38,786
$877,007 $689,288
$877,007 $689,288
$877,007 $689,288 $91,495
$877,007 $689,288 $572,927
$877,007 $689,288 $212,584
$877,007 $689,288
$877,007 $689,288
$877,007 $95,091
$877,007 $95,091
$877,007 $95,091 $91,495
$877,007 $95,091 $572,927
$877,007 $95,091 $212,584
$877,007 $95,091
$877,007 $95,091
$877,007 $53,842
$877,007 $53,842
$877,007 $53,842 $91,495
$877,007 $53,842 $572,927
$877,007 $53,842 $212,584
$877,007 $53,842
$877,007 $53,842

_x000D_ Classification: Public


#
Arithmetic operations - You can perform all the operation like (+,-,*% ..etc in calculated column )
If, Blank, is Blank
And, Or
Switch

Logical Functions AND Function


Logical Functions IF Function
Logical Functions IFERROR Function
Logical Functions OR Function
Logical Functions SWITCH Function

1
2
3
3
4

_x000D_ Classification: Public


#
AND(<logical1>,<logical2>) Checks whether both arguments are TRUE, and returns TRUE if both arguments a
IF(logical_test>,<value_if_true>, valuChecks if a condition provided as the first argument is met. Returns one value if
IFERROR(value, value_if_error) Evaluates an expression and returns a specified value if the expression returns an
OR(<logical1>,<logical2>) Checks whether one of the arguments is TRUE to return TRUE. The function retur
SWITCH(<expression>, <value>, <result>Evaluates an expression against a list of values and returns one of multiple possib

North
East
west
south
Northeast East

_x000D_ Classification: Public


#
s TRUE if both arguments are TRUE. Otherwise returns false.
met. Returns one value if the condition is TRUE, and returns another value if the condition is FALSE.
if the expression returns an error; otherwise returns the value of the expression itself.
rn TRUE. The function returns FALSE if both arguments are FALSE.
urns one of multiple possible result expressions.

_x000D_ Classification: Public


#
Category Function
Statistical Functions AVERAGE Function
Statistical Functions AVERAGEX Function
Statistical Functions COUNT Function
Statistical Functions COUNTA Function
Statistical Functions COUNTAX Function
Statistical Functions COUNTBLANK Function
Statistical Functions COUNTROWS Function
Statistical Functions COUNTX Function
Statistical Functions DISTINCTCOUNT Function
Statistical Functions MAX Function
Statistical Functions MAXX Function
Statistical Functions MIN Function
Statistical Functions MINX Function
Statistical Functions RANK.EQ Function
Statistical Functions SUM Function

Statistical Functions SUMX Function

_x000D_ Classification: Public


#
Syntax Description
AVERAGE(<column>) Returns the average (arithmetic mean) of all the numbers in a column.
AVERAGEX(<table>,<expression>) Calculates the average (arithmetic mean) of a set of expressions evaluated over a
COUNT(<column>) The COUNT function counts the number of cells in a column that contain numbe
COUNTA(<column>) The COUNTA function counts the number of cells in a column that are not empt
COUNTAX(<table>,<expression>) The COUNTAX function counts nonblank results when evaluating the result of an
COUNTBLANK(<column>) Counts the number of blank cells in a column.
COUNTROWS(<table>) The COUNTROWS function counts the number of rows in the specified table, or
COUNTX(<table>,<expression>) Counts the number of rows that contain a number or an expression that evaluat
DISTINCTCOUNT(<column>) The DISTINCTCOUNT function counts the number of different cells in a column
MAX(<column>) Returns the largest numeric value in a column.
MAXX(<table>,<expression>) Evaluates an expression for each row of a table and returns the largest numeric v
MIN(<column>) Returns the smallest numeric value in a column. Ignores logical values and text.
MINX(<table>, < expression>) Returns the smallest numeric value that results from evaluating an expression fo
RANK.EQ(<value>, <columnName>[, Returns the ranking of a number in a list of
<order>]) numbers.
SUM(<column>) Adds all the numbers in a column.

SUMX(<table>, <expression>) Returns the sum of an expression evaluated for


each row in a table.

45 48
20 23
26 29
43 46
30 33
23 26
24 27
44 47
49 52
30 33
33 36
367 400

_x000D_ Classification: Public


#
an) of all the numbers in a column.
mean) of a set of expressions evaluated over a table.
mber of cells in a column that contain numbers.
umber of cells in a column that are not empty. It counts not just rows that contain numeric values, but also rows that contain nonblank value
blank 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 th

he number of rows in the specified table, or in a table defined by an expression.


ntain a number or an expression that evaluates to a number, when evaluating an expression over a table.
ts the number of different cells in a column of numbers.

w of a table and returns the largest numeric value.


n a column. Ignores logical values and text.
hat results from evaluating an expression for each row of a table.

_x000D_ Classification: Public


#
s, but also rows that contain nonblank values, including text, dates, and logical values.
e COUNTA function, but is used to iterate through the rows in a table and count rows where the specified expressions results in a nonblank

_x000D_ Classification: Public


#
specified expressions results in a nonblank result.

_x000D_ Classification: Public


#
Category Function
Text functi CONCATENATE Function
Text functi FIND Function
Text functi LEFT Function
Text functi LEN Function
Text functi LOWER Function
Text functi MID Function
Text functi REPLACE Function
Text functi RIGHT Function
Text functi SEARCH Function
Text functi SUBSTITUTE Function
Text functi VALUE Function
Statistical FIXED Function

_x000D_ Classification: Public


#
Syntax Description
CONCATENATE(<text1>, <text2>) Joins two text strings into one tex
FIND(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]]) Returns the starting position of o
LEFT(<text>, <num_chars>) Returns the specified number of c
LEN(<text>) Returns the number of characters
LOWER(<text>) Converts all letters in a text string
MID(<text>, <start_num>, <num_chars>) Returns a string of characters from
REPLACE(<old_text>, <start_num>, <num_chars>, <new_text>) REPLACE replaces part of a text st
RIGHT(<text>, <num_chars>) RIGHT returns the last character o
SEARCH(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]]) Returns the number of the charac
SUBSTITUTE(<text>, <old_text>, <new_text>, <instance_num>) Replaces existing text with new te
VALUE(<text>) Converts a text string that represe
FIXED(<number>, <decimals>, <no_commas>) Rounds a number to the specified

_x000D_ Classification: Public


#
Description
Joins two text strings into one text string.
Returns the starting position of one text string within another text string. FIND is case-sensitive.
Returns the specified number of characters from the start of a text string.
Returns the number of characters in a text string.
Converts all letters in a text string to lowercase.
Returns a string of characters from the middle of a text string, given a starting position and length.
REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string.
RIGHT returns the last character or characters in a text string, based on the number of characters you specify.
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
Replaces existing text with new text in a text string.
Converts a text string that represents a number to a number.
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 wit

_x000D_ Classification: Public


#
ight. Search is case-insensitive and accent sensitive.

result be returned with or without commas.

_x000D_ Classification: Public


#
Category Function
Filter Functions RELATED Function
Filter Functions RELATEDTABLE Function
Information Functions LOOKUPVALUE Function

Filter Functions ALL Function

Filter Functions CALCULATE Function


Filter Functions FILTER Function
Filter Functions ALLEXCEPT Function
Filter Functions ALLSELECTED Function
Filter Functions USERELATIONSHIP Function

_x000D_ Classification: Public


#
Syntax
RELATED(<column>)
RELATEDTABLE(<tableName>)
LOOKUPVALUE( <result_columnName>, <search_columnName>, <search_value>[, <search_columnName>, <search_va

ALL( {<table> | <column>[, <column>[, <column>[,…]]]} )

CALCULATE(<expression>,<filter1>,<filter2>…)
FILTER(<table>,<filter>)
ALLEXCEPT(<table>,<column>[,<column>[,…]])
ALLSELECTED([<tableName> | <columnName>])
USERELATIONSHIP(<columnName1>,<columnName2>)

_x000D_ Classification: Public


#
Description
Returns a related value from another table.
Evaluates a table expression in a context modified by the given filters.
Returns the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value.
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 us
clearing filters and creating calculations on all the rows in a table.
Evaluates an expression in a context that is modified by the specified filters.
Returns a table that represents a subset of another table or expression.
Removes all context filters in the table except filters that have been applied to the specified columns.
Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters.
Specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2.

_x000D_ Classification: Public


#

You might also like