Power BI Dax Functions
Function | Syntax | Explanation |
---|---|---|
ADDCOLUMNS | ADDCOLUMNS(table, new_column1, expression1, new_column2, expression2, ...) | Adds new columns to a table based on expressions. |
ALL | ALL(table) | Removes filters from a table or columns. |
AVERAGE | AVERAGE(table[column]) | Calculates the average of values in a column. |
AVERAGEX | AVERAGEX(table, expression) | Calculates the average of an expression for each row in a table. |
BLANK | BLANK() | Returns a blank or null value. |
CALCULATETABLE | CALCULATETABLE(table, filter1, filter2, ...) | Evaluates a table expression with modified filters. |
COALESCE | COALESCE(value1, value2, ...) | Returns the first non-blank value from a list of expressions. |
CONTAINS | CONTAINS(table, table[column], value) | Checks if a column contains a specific value. |
COUNTDISTINCT | COUNTDISTINCT(table[column]) | Counts the number of distinct values in a column. |
COUNTROWS | COUNTROWS(table) | Counts the number of rows in a table or table expression. |
CROSSFILTER | CROSSFILTER(table1[column], table2[column], filter_type) | Defines a filter direction between two tables. |
CURRENTGROUP | CURRENTGROUP() | Returns the current row group in a table. |
DISTINCT | DISTINCT(table[column]) | Returns a table with unique values from a column. |
EARLIER | EARLIER(column) | References a column value in the current row. |
EARLIEST | EARLIEST(table[column]) | Returns the earliest value in a column. |
FILTER | FILTER(table, condition) | Returns a table that includes only rows that meet the specified condition. |
GENERATESERIES | GENERATESERIES(start_value, end_value, [step_value]) | Generates a table with a series of numbers. |
GROUPBY | GROUPBY(table, column1, column2, ...) | Groups rows and performs aggregations on grouped data. |
HASONEFILTER | HASONEFILTER(table[column]) | Checks if a column has a single filter context. |
IF | IF(condition, [value_if_true], [value_if_false]) | Returns one value if a condition is true and another if it's false. |
ISEMPTY | ISEMPTY(value) | Checks if a value is empty and returns TRUE or FALSE. |
KEEPFILTERS | KEEPFILTERS(expression) | Preserves existing filters while evaluating an expression. |
LASTDATE | LASTDATE(table[column]) | Returns the latest date from a column. |
LEFT | LEFT(text, num_chars) | Returns the leftmost characters from a text string. |
LEN | LEN(text) | Returns the number of characters in a text string. |
MAX | MAX(table[column]) | Retrieves the maximum value from a column. |
MAXX | MAXX(table, expression) | Calculates the maximum of an expression for each row in a table. |
MIN | MIN(table[column]) | Retrieves the minimum value from a column. |
MINX | MINX(table, expression) | Calculates the minimum of an expression for each row in a table. |
NOW | NOW() | Returns the current date and time. |
OR | OR(logical1, logical2, ...) | Returns TRUE if any of the logical expressions are TRUE. |
RANKX | RANKX(table, expression, [value], [order], [ties]) | Assigns a rank to each row in a table based on an expression. |
RELATEDTABLE | RELATEDTABLE(table) | Returns a table of related records. |
RIGHT | RIGHT(text, num_chars) | Returns the rightmost characters from a text string. |
SELECTCOLUMNS | SELECTCOLUMNS(table, new_column1, expression1, new_column2, expression2, ...) | Creates a new table with selected columns and expressions. |
SUBSTITUTE | SUBSTITUTE(text, old_text, new_text, [instance_num]) | Replaces occurrences of a specified substring with another substring. |
SUM | SUM(table[column]) | Calculates the sum of values in a column. |
SUMMARIZE | SUMMARIZE(table, column1, column2, ...) | Creates a summary table with aggregated values. |
SUMX | SUMX(table, expression) | Calculates the sum of an expression for each row in a table. |
SWITCH | SWITCH(expression, value1, result1, value2, result2, ...) | Performs a series of tests and returns the result for the first true condition. |
TRIM | TRIM(text) | Removes leading and trailing spaces from a text string. |
UPPER | UPPER(text) | Converts text to uppercase. |
USERELATIONSHIP | USERELATIONSHIP(table1[column], table2[column]) | Specifies a relationship to be used in a DAX expression. |
VALUES | VALUES(table[column]) | Returns a single column table of unique values from a column. |