TOTALQTD

The TOTALQTD function evaluates an expression from the first day of the current context quarter to the last day of the current context.

Syntax

TOTALQTD(
    expression,
    dates
    [, filter]
)

Parameters
  • expression: Expression that returns a scalar.
  • dates: Column containing dates.
  • filter: Optional argument. Filter to apply to the current context.
Returned value

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.

Additional Information

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])

Examples

If we consider the following table containing information on sales:

TOTALQTD function. Example of use

...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:

TOTALQTD function. Example of use

It can be seen how the measure is reset to zero at the beginning of each quarter.

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