Dax Cheat Sheet
Dax Cheat Sheet
Specifies the cross-filtering direction column1, column2: Columns between which the
CROSSFILTER(<column1>,
CROSSFILTER to be used in a calculation for
<column2>, <direction>)
cross-filtering is applied.
relationships between two columns. direction: Filter direction.
RAJAT SAXENA 01
PowerBI DAX CHEAT SHEET
RETURNS A TABLE WITH A SUBSET COLUMN: THE COLUMN FOR WHICH TO
FUNCFTIILOTNE RNAME OF RODWES STHCARTI PMTEEITO FILTERS(<COLUMN>)
AN GIVEN
SYNTAX RETURPNA TRHAE MFILETTEER RVAS
CONDITION.
Returns a related value from another columnName: The column for which to return a
RELATED table.
RELATED(<columnName>)
related value.
RAJAT SAXENA 02
PowerBI DAX CHEAT SHEET
EVALUATES THE EXPRESSION FOR TOTALYTD(<EXPRESSION>, EXPRESSION: THE EXPRESSION TO EVALUATE.
FUNTCOTIAOLNY NTADMETHE DYEASRC TROI DPATTIEO IN
<DATES>Y
THE [N, <TFAILXTER>]
DATES:
[, A CPOALURMANM CEOTNTEAR
CURRENT CONTEXT. <YEAR_END_DATE>]) FILTER
RAJAT SAXENA 03
PowerBI DAX CHEAT SHEET
EVALUATES THE EXPRESSION FOR TOTALYTD(<EXPRESSION>, EXPRESSION: THE EXPRESSION TO EVALUATE.
FUNTCOTIAOLNY NTADMETHE DYEASRC TROI DPATTIEO IN
<DATES>Y
THE [N, <TFAILXTER>]
DATES:
[, A CPOALURMANM CEOTNTEAR
CURRENT CONTEXT. <YEAR_END_DATE>]) FILTER
Returns column:
PRODUCT the product of numbers in a column. PRODUCT(<column>) The column containing the numbers to calculate
the product of.
Returns table:
the product of an expression PRODUCTX(<table>, The table containing rows for which the
PRODUCTX <expression>)
evaluated for each row in a table. expression is evaluated.
number:
Rounds
ROUND(<number>, The number to round.
ROUND a number to the specified number of
<num_digits>) num_digits: The number of digits to round the
digits.
number to.
Adds column:
SUM all the numbers in a column.
SUM(<column>)
The column containing the numbers to sum.
Returns table:
SUMX(<table>,
SUMX the sum of an expression evaluated
<expression>)
The table containing rows for which the
for each row in a table. expression is evaluated.
RAJAT SAXENA 04
PowerBI DAX CHEAT SHEET
Returns a summary table for the requested SUMMARIZECOLUMNS(<groupBy_ groupBy_columnName: The column by which to
data, similar to SUMMARIZE, but with
SUMMARIZECOLUMNS added functionality.
columnName>, <filterName>, group.
<filterExpression>,...) filterExpression: Optional filter expression.
Applies the result of a table TREATAS(<table>, <column1>, table: The table to be treated as a filter.
TREATAS column: The column(s) on which to apply the filter.
expression as filters on columns. <column2>,...)
Ignores all relationships between NORELATIONSHIPS(<table>, table: The table to ignore relationships for.
NORELATIONSHIPS tables during a query. <column>, ...) column: The columns to apply this behavior to.
RAJAT SAXENA 05
PowerBI DAX CHEAT SHEET
Performs an inner join between two NATURALINNERJOIN(<table1>, table1: The first table.
NATURALINNERJOIN tables. <table2>) table2: The second table to join with.
Performs a left outer join between two NATURALLEFTOUTERJOIN(<table1 table1: The first table.
NATURALLEFTOUTERJOIN tables. >, <table2>) table2: The second table to join with.
EVALUATE Executes a table expression. EVALUATE <expression> expression: The expression to evaluate.
RAJAT SAXENA 06
PowerBI DAX CHEAT SHEET
Returns the maximum value in a column: The column containing the values to
MAX column.
MAX(<column>)
check.
Returns the maximum value, but it column: The column containing the values to
MAXA MAXA(<column>)
includes logical values. check.
Returns the end of the month for a EOMONTH(<start_date>, start_date: The start date.
EOMONTH given date. <months>) months: The number of months to add.
Returns the end of the year for a given EOYEAR(<start_date>, start_date: The start date.
EOYEAR date. <years>) years: The number of years to add.
07
RAJAT SAXENA
PowerBI DAX CHEAT SHEET
NEXT Returns the next period for a given date. NEXT(<dates>) dates: The date column.
NEXTDAY Returns the next day for a given date. NEXTDAY(<dates>) dates: The date column.
Returns the next month for a given dates: The date column.
NEXTMONTH NEXTMONTH(<dates>)
date.
Returns the next quarter for a given NEXTQUARTER(<dates>) dates: The date column.
NEXTQUARTER date.
08
RAJAT SAXENA
PowerBI DAX CHEAT SHEET
PREVIOUSQUARTER Returns the next day for a given date. PREVIOUSQUARTER(<dates>) dates: The date column.
Returns the next month for a given dates: The date column.
PREVIOUSYEAR PREVIOUSYEAR(<dates>)
date.
Sorts the data based on a column or ORDERBY(<expression>, expression: The expression or column to sort.
ORDERBY expression. <sort_order>) sort_order: ASC/DESC.
RAJAT SAXENA 09
PowerBI DAX CHEAT SHEET
FUNCTION NAME DESCRIPTION SYNTAX PARAMETERS
Returns a delimited text string with child_column: The column representing child IDs.
PATH(<child_column>,
PATH the IDs of all parents to the current
<parent_column>) parent_column: The column representing parent IDs.
row.
RAJAT SAXENA 10
PowerBI DAX CHEAT SHEET
RAJAT SAXENA 11
PowerBI DAX CHEAT SHEET
SELECTEDCOLUMNS(<table>,
Returns the selected columns from a table: The table to retrieve columns from.
SELECTEDCOLUMNS <columnName1>,
table. columnName: The names of columns to retrieve.
<columnName2>, ...)
RAJAT SAXENA 12
PowerBI DAX CHEAT SHEET
RAJAT SAXENA 13
14
Returns the arithmetic mean of all AVERAGE(<column>) column: column containing the values to average.
AVERAGE numbers in a column.
Counts the number of cells in a COUNT(<column>) column: column containing the values to count.
COUNT column containing non-blank values.
Counts the number of distinct values column: column containing the values to find
DISTINCT COUNT in a column.
DISTINCTCOUNT(<column>) distinct values.
RAJAT SAXENA 14
PowerBI DAX CHEAT SHEET
Returns the median of the numbers in column: column containing the numbers for which to
MEDIAN a column.
MEDIAN(<column>) calculate the median value.
Returns the smallest value in a column or column: column containing the values for which to
MIN between two scalar expressions.
MIN(<column>)
find the smallest value.
Returns the variance for the entire columnName: name of an existing column using
VAR.P VAR.P(<columnName>)
population. standard DAX syntax. Cannot be an expression.
Counts the number of distinct values column: column containing the values to find
DISTINCT COUNT in a column.
DISTINCTCOUNT(<column>) distinct values.
RAJAT SAXENA 15
PowerBI DAX CHEAT SHEET
Returns TRUE if the values of all CONTAINS(<table>, table: any DAX expression returning a data table.
CONTAINS referenced columns exist or are <columnName>, <value>[, columnName: name of an existing column, specified
using standard DAX syntax.
contained in those columns; <columnName>, <value>...])
Checks if a value is an error and value: boolean TRUE if the value is an error;
ISERROR returns TRUE or FALSE.
ISERROR(<value>)
otherwise, FALSE.
Returns TRUE if the number is even number: value to test. If not an integer, it is
ISEVEN ISEVEN(<number>) truncated.
or FALSE if the number is odd.
RAJAT SAXENA 16
PowerBI DAX CHEAT SHEET
FUNCTION NAME DESCRIPTION SYNTAX PARAMETERS
Returns TRUE if the values of all CONTAINS(<table>, table: any DAX expression returning a data table.
CONTAINS referenced columns exist or are <columnName>, <value>[, columnName: name of an existing column, specified
using standard DAX syntax.
contained in those columns; <columnName>, <value>...])
Checks if a value is an error and value: boolean TRUE if the value is an error;
ISERROR returns TRUE or FALSE.
ISERROR(<value>)
otherwise, FALSE.
Returns TRUE if the number is even number: value to test. If not an integer, it is
ISEVEN ISEVEN(<number>) truncated.
or FALSE if the number is odd.
RAJAT SAXENA 17