EARLIEST

The EARLIEST function is used in calculated columns and allows access to the value of a column (of the row being analyzed) in nested calculations, this value being the one corresponding to the outermost evaluation level.

Syntax

EARLIEST(
    column
)

Parameters
  • column: Column name or expression that returns a column.
Returned value

The EARLIEST function returns the value of the current row in the column column corresponding to the outermost evaluation level.

In most cases it can be said that the EARLIEST function returns an access "to the current row".

If used in a measure, the function returns an error.

Additional Information

The EARLIEST function returns an error if there is no row context prior to parsing the table.

Examples

In this example we start from the following table, the result of adding the sales table by country and gender of the customer:

Tabla de datos

If we wanted to add a new column including the total sales for the country involved in the row being considered, we could achieve it with the following calculated field:

Ventas totales = 
    CALCULATE(
        SUM(Tabla[Ventas]),
        ALL(Tabla),
        Tabla[Country]=EARLIEST(Tabla[Country])
    )

Note that we need to involve the entire table in the calculation, for which we can use the ALL function. The result is as follows:

Función EARLIEST
Related functions
Category
Filter
Submitted by admin on Wed, 07/17/2019 - 18:22