FIRSTDATE

The FIRSTDATE function returns the first day in the current context for the specified date column.

Syntax

FIRSTDATE(
    dates
)

Parameters
  • dates: Column containing dates.
Returned value

The FIRSTDATE function returns a table containing a single column with a single row with a date value.

Additional Information

The dates argument can be a reference to a column containing dates, an expression that returns a table with a single column containing dates, or a Boolean expression that defines a table with a single column containing dates.

This function can be used as an argument of any function that requires a table, but it can also be used where a date is required.

Examples

Consider the following Ventas table containing sales dates:

FIRSTDATE function. Example of use

If we take this information to a matrix in which we have the name of the month in rows and the sum of the sales amounts in columns, we have:

FIRSTDATE function. Example of use

Under these conditions, the context of the cells in the Importe column is given by the month in which the sale occurred. If we now define the Primera Venta measure:

Primera venta = FIRSTDATE(Ventas[Fecha])

...in which we add as an argument the column of the sales table that includes the dates on which the sales occurred, by taking this measure to the matrix we obtain:

FIRSTDATE function. Example of use

That is, the first of the dates included in the Ventas[Fecha] column is displayed in the Primera venta column within the context defined by each row.

Related functions
Category
Time intelligence
Submitted by admin on Tue, 12/04/2018 - 11:18