Function CALCULATE

CALCULATE is one of the most commonly used functions in DAX. It is used to calculate expressions, usually given by some aggregation function, with use of one or more filters. It is not incorrect to use CALCULATE without a filter, but that’s not much point. The strength of this function is the ability of combining expression with a range of DAX functions that narrow set of data to perform aggregation with…

Iterator functions

In addition to the usual functions for data aggregation DAX has a special class of functions that change context of the execution for computing operations, and yet we call them the “iterators”. Sometimes we also call them the “X” functions, because after the name of the aggregation operation (SUM, AVERAGE, COUNT) stands the letter “X”, which indicates that these are iterators (SUMX, AVERAGEX, COUNTX). More in the text that follows…

DAX and relationships

In one of the earlier recipes was discussed about Data model, tables that we’re adding to it and relationships between them. This relationships are not very useful when when we’re writing DAX expressions. If we wan to use, as a formula argument, column from related column you should somehow emphasize it. This is done by using functions RELATED and RELATEDTABLE, and about which you can read more in the following text …

DAX, the aggregation functions

Aggregation of data is a process that we’re implicitly performing every time we drag a reporting dimension in the field Values. However, when you create complex reports, it is useful to use functions for aggregation (SUM, AVERAGE, COUNT) to create measures that will be used in the report. Once thought out measures may be used as a building block to create complex DAX expressions.

Calculated columns manipulation

In one of previous recipes we were talking about basic concepts of DAX, where you’ve got acquainted with calculated columns. Now let’s say something about how to manipulate them within the table that exist in the Data model. First, we will show how to filter them, then how to remove filters and how to perform sorting. Then we will be talking about adding a new column, “freezing” and “unfreezing” columns, changing the column width, renaming…