Ranking

In one of the previous “recipes” you could get acquainted with the EARLIER function. Here you could learn how to use this function to calculate the rank based on highest price of the product within a table. This can be done much more easily, by applying the RANKX function. Let’s see how it is used and what other options are also available when ranking data through DAX.

Belonging to a set

If we want to check, within the DAX statement, whether the element belongs to the given set we will use the operator IN and then, in the extension, in curly brackets, list the elements that belong to the set. In this way we can associate a filter within the CALCULATE function that specifies more than one value. A similar effect is achieved with the CONTAINSROW function.

KEEPFILTERS function

When we use the DAX function CALCULATE and give it the filter values ​​as arguments as a result we will get a Power Pivot report filled with rows containing the same values. Although these values ​​correspond to the given filter this way of displaying data is not the best solution. To make report neat, we can use the FILTER function or, even better, the KEEPFILTERS function about which you will learn more if you read the text that follows …

CONCATENATEX function

The CONCATENATE function is used to join strings in the DAX language. DAX also has a corresponding “X” function that acts as an iterator and allows joining of multiple strings with an option to use delimiter and sorting direction by given expression. In this post, you will learn how to use the CONCATENATEX function in a specific example, by displaying all brands in relation to the filter of the manufacturer to which they belong.

C/S ratio

How good are the sales results? There are many indicators that can be used to control sales, and one of them is a C/S ratio. It represents the relationship between the contribution (aka difference in price, earnings, margin) and the amount of sales. By monitoring this indicator we can track change of earnings through time and that can show us how well a trade margin is formed.