The NEXTDAY function returns a table containing a column with the date corresponding to the day after the current context.
NEXTDAY(
dates
)
- dates: Column containing dates.
The NEXTDAY function returns a table.
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 returns the date corresponding to the day after the one considered in the current context. In other words, the set of dates returned by the function (in this case only one) is never part of the current context.
If, given a table with sales, we define the measure:
Ventas = SUM(FactSales[SalesAmount])
...calculating the total sales, and the measure
Ventas un día después = CALCULATE(
[Ventas],
NEXTDAY(DimDate[Datekey])
)
If we take both measures to a matrix in which we show the calendar days as the row header, the result is the following:
In this case, the period considered in the calculation of the measure [Ventas un día después] is the day after the current context.
If, in the previous scenario, we modify the matrix to show only the sales by months, the result is the following:
In this example, each figure returned by the measure [Ventas un día después] corresponds to sales on the 1st of the month following the one considered in the context. To confirm this, we can look at one of the figures returned by this measure, for example, the € 6,824,039.74 in January 2007. If we now take the sales per day around February 1 to a new matrix, we obtain:
Indeed, the € 6,824,039.74 coincide with the sales of February 1, as we can see.