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.

Functions EARLIER and EARLIEST

Formula in calculated column will be evaluated using the row context, which means that all columns that are referenced give results in a row in which the formula is located. Evaluation continues for each subsequent row, so that by the end of the table. Since calculating final sum takes place iteratively we can hardly see what happened in the previous row as you would do in traditional Excel formulas. Here come into play EARLIER and EARLIEST functions.