0% found this document useful (0 votes)
180 views

Formulas DAX in Power BI

This document provides a summary of various date, time, math, statistical, filter, table manipulation, logical, and information functions and operators in DAX. Some key functions described include CALENDAR, TOTALYTD, SAMEPERIODLASTYEAR, SUM, AVERAGE, SUMX, COUNTX, DISTINCTCOUNT, RANKX, FILTER, CALCULATE, HASONEVALUE, ALL, IF, AND, SUBSTITUTE, USERPRINCIPALNAME. Operators covered include comparison operators like = and <>, text concatenation using &, and logical operators like AND, OR, IN.

Uploaded by

Hernaldo Aburto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views

Formulas DAX in Power BI

This document provides a summary of various date, time, math, statistical, filter, table manipulation, logical, and information functions and operators in DAX. Some key functions described include CALENDAR, TOTALYTD, SAMEPERIODLASTYEAR, SUM, AVERAGE, SUMX, COUNTX, DISTINCTCOUNT, RANKX, FILTER, CALCULATE, HASONEVALUE, ALL, IF, AND, SUBSTITUTE, USERPRINCIPALNAME. Operators covered include comparison operators like = and <>, text concatenation using &, and logical operators like AND, OR, IN.

Uploaded by

Hernaldo Aburto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

> Date & time functions > DAX Operators

Glossary of DAX CALENDAR(<start_date>, <end_date>)

Returns a table with a single column named "Date" that contains a contiguous set of dates.

functions and operators Comparison operators 3 Meaning

= Equal to

> Time intelligence functions = = Strict equal to

> Math & statistical functions TOTALYTD(<expression>,<dates>[,<filter>][,<year_end_date>])

Evaluates the year-to-date value of the expression in the current context


> Greater than

SAMEPERIODLASTYEAR(<dates>)

SUM(<column>)
Returns a table that contains a column of dates shifted one year back in time.

Adds all the numbers in a column < Smaller than

AVERAGE(<column>)

Returns the average (arithmetic mean) of all the numbers in a column


> = Greater than or equal to

SUMX(<table>, <expression>)

Returns the sum of an expression evaluated for each row in a table


> Relationship functions
= < Smaller than or equal to
COUNTX(<table>, <expression>)
CROSSFILTER()

Counts the number of rows from an expression that evaluates to a non-blank value Specifies the cross-filtering direction to be used in a calculation
< > Not equal to
AVERAGEX(<table>, <expression>)
RELATED()

Calculates the average (arithmetic mean) of a set of expressions evaluated over a table Returns a related value from another table.

DIVIDE(<numerator>, <denominator> [,<alternateresult>])

Performs division and returns alternate result or BLANK() on division by 0


Text operator Meaning 3 Example
MIN(<column>)

Returns a minimum value of a column > Table manipulation functions Concatenates


Concatenates text values | [City]&",
& text values "&[State]

MAX(<column>)

SUMMARIZE(<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)

Returns a maximum value of a column


Returns a summary table for the requested totals over a set of groups
COUNTROWS([<table>])

Counts the number of rows in a table


DISTINCT(<table>)
Logical 3 Example
Returns a table by removing duplicate rows from another table or expression
operator Meaning
DISTINCTCOUNT(<column>)

ADDCOLUMNS(<table>, <name>, <expression>[, <name>, <expression>]…)


([City] = "Bru") && ([Return] =
Counts the number of distinct values in a column
Adds calculated columns to the given table or table expression && AND condition "Yes"))
RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]])

SELECTCOLUMNS(<table>, <name>, <expression>[, <name>, <expression>]…)

Returns the ranking of a number in a list of numbers for each row in the table argument. ([City] = "Bru") || ([Return] =
Selects calculated columns from the given table or table expression.

|| OR condition "Yes"))

> Filter functions OR condition


Product[Color] IN {"Red", "Blue",
IN {} for each row "Gold"}

FILTER(<table>, <filter>)

> Text functions


Returns a table that is a subset of another table or expression
SUBSTITUTE(<text>, <old_text>, <new_text>, <instance_num>)

CALCULATE(<expression>[, <filter1> [, <filter2> [, …]]])


Replaces existing text with new text in a string.

Evaluates an expression in a filter context

HASONEVALUE(<columnName>)

Returns TRUE when the context for columnName has been filtered down to one distinct value

> Information functions


only. Otherwise it is FALSE

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

Returns all the rows in a table, or all the values in a column, ignoring any filters that
might have been applied.
USERPRINCIPALNAME()

Returns the user principal name or email address. This function has no arguments.

> Logical functions


IF(<logical_test>, <value_if_true>[, <value_if_false>])

Checks a condition, and returns a certain value depending on whether it is true or false
> DAX statements
AND(<logical 1>, <logical 2>)
VAR(<name> = <expression>)

Checks whether both arguments are TRUE, and returns TRUE if both arguments are TRUE. Stores the result of an expression as a named variable. To return the variable, use RETURN
Otherwise, it returns FALSE after the variable is defined.

OR(<logical 1>, <logical 2>)

Checks whether one of the arguments is TRUE to return TRUE. The function returns FALSE if
both arguments are FALSE

NOT(<logical>)

Changes TRUE to FALSE and vice versa


> Other functions Can’t find the function you’re looking for?
Take a look at the Microsoft documentation
SWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])
BLANK()

Evaluates an expression against a list of values and returns one of multiple possible Returns a blank.

result

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy