The TOTALQTD function evaluates an expression from the first day of the current context quarter to the last day of the current context.
TOTALQTD(
expression,
dates
[, filter]
)
- expression: Expression that returns a scalar.
- dates: Column containing dates.
- filter: Optional argument. Filter to apply to the current context.
The TOTALQTD function returns a scalar that represents the expression given as the first argument evaluated for dates between the first day of the current context quarter and the last day of the current context.
This function identifies the last day of the current context and considers all dates from the first day of the quarter to which that day belongs to this last day. This means that if more than one quarter is involved in the current context, only the last one is considered.
The following functions are equivalent:
TOTALQTD(expression, dates[, filter])
CALCULATE(expression, DATESQTD(dates)[, filter])
If we consider the following table containing information on sales:
...we define the following measure:
Ventas = SUM(Ventas[Importe])
...and then the "Ventas QTD" measure that calculates the total sales from the beginning of the quarter of the current context to the last date of the current context:
Ventas QTD = TOTALQTD(
Ventas[Ventas],
Calendario[Fecha]
)
If we take this last measure to a matrix, we obtain the following result:
It can be seen how the measure is reset to zero at the beginning of each quarter.