Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

MESMO_PERIODO_ANO_ANTERIOR

On this page (10)

The same date range, one year earlier.

FieldValue
CategoryDate and time
TypeAggregation (operates on a set of rows)
Arity2 arguments (fixed)
Compiles to SQL (calculated column)No
VersionFormula engine v3, with fiscal/4-4-5 calendar support.

Aliases#

Canonical name: MESMO_PERIODO_ANO_ANTERIOR. Accepted aliases (case-insensitive): sameperiodlastyear, spla.

Syntax#

code
MESMO_PERIODO_ANO_ANTERIOR(expr; arg2)

All arguments are expressions.

Returns#

The measure's value in the shifted period, or blank.

Null handling#

With no data in the shifted period, it returns blank (not zero).

Evaluation context#

Time intelligence — finds the group's reference date and re-evaluates the measure over the VISUAL's rows (uses allRows) that fall within the window. Switches to fiscal/4-4-5 when the model has that calendar.

Differences from DAX#

  • DAX equivalent: SAMEPERIODLASTYEAR
  • Compatibility: DIFFERS from DAX — different semantics, watch out
  • Note: Shifts the group's range by one year and aggregates over the visual's rows; returns BLANK (not zero) when there is no data in the shifted period.

Examples#

code
MESMO_PERIODO_ANO_ANTERIOR(SOMA(receita); dia)

Example with values#

Input: group March/25 compared with the same period in 2024.

code
MESMO_PERIODO_ANO_ANTERIOR(SOMA(receita); dia)  →  100

Expected result: 100

Business example#

Compare this month's revenue with the same month last year.

Common errors#

Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.


← Back to the formula index

Related links