DAX Cheat Sheet

What is DAX?

It is the programming language for Power Pivot, SSAS Tabular and Power BI.

It resembles Excel because it was born in PowerPivot. But it has no concept of <row> and <column> and has different type system.

The most important, it has many new functions.

The most two are measure and calculated column:

Measure is used to calculate aggregates, e.g., Sum, Avg and evaluated in the context of the cell in a report or a DAX query.

Calculated column evaluates each row and is computed at the low level within the table it belongs to.

Some Common Dax Expressions:

LOOKUP:

  • Return the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value
  • LOOKUPVALUE(Result Column Name, Search Column Name, Search Column value)

FILTER:

  • Return a subset of a table or expression
  • FILTER(<table>,<filter>)

ALL:

  • Return all the rows in a table, or values in a column, ignoring any filters that may have been applied
  • ALL(<table> or <column>)

RELATED

  • Returns a related value from another table
  • RELATED(<column>)

CALCULATE

  • Evaluates an expression in a context that is modifies by specific filters
  • CALCULATE(<expression>,<filter1>,<filter2>)

If you are interested in or have any problems with DAX or Business Intelligence, feel free to contact me.

Or you can connect with me through my LinkedIn.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s