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.

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…