Skip to content

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

DATAS_NO_PERIODO

On this page (10)

Inside CALCULAR: a window of N periods from the given date (negative N goes back in time). It's the moving total — 3 months, 12 months, 7 days.

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

Aliases#

Canonical name: DATAS_NO_PERIODO. Accepted aliases (case-insensitive): datesinperiod.

Syntax#

code
DATAS_NO_PERIODO(coluna; arg2; arg3; [arg4])

The 1st argument is the name of a column (bare identifier); the others are expressions.

Returns#

CALCULAR modifier (redefines the date window).

Null handling#

Invalid or missing dates become a friendly error or blank, depending on the function.

Evaluation context#

Modifier — only makes sense INSIDE CALCULAR (or another context function that accepts it). Outside of that, it warns you instead of returning a wrong number.

Differences from DAX#

  • DAX equivalent: DATESINPERIOD
  • Compatibility: DIFFERS from DAX — different semantics, watch out
  • Note: Window of N periods from a date, used inside CALCULAR; operates on the visual's rows.

Examples#

code
CALCULAR(SOMA(receita); DATAS_NO_PERIODO(dia; ULTIMA_DATA(dia); -3; "MES"))

Example with values#

Input: last 3 months up to the group's last date.

code
CALCULAR(SOMA(receita); DATAS_NO_PERIODO(dia; ULTIMA_DATA(dia); -3; "MES"))  →  470

Expected result: 470

Business example#

Time analysis — order age, accrual month/year, accounting close.

Common errors#

An invalid unit becomes a guided error ("DIA", "MES", "TRI", or "ANO").


← Back to the formula index

Related links