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.
| Field | Value |
|---|---|
| Category | Date and time |
| Type | Aggregation (operates on a set of rows) |
| Arity | 3 to 4 arguments |
| Compiles to SQL (calculated column) | No |
| Version | Formula engine v3, with fiscal/4-4-5 calendar support. |
Aliases#
Canonical name: DATAS_NO_PERIODO. Accepted aliases (case-insensitive): datesinperiod.
Syntax#
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#
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.
CALCULAR(SOMA(receita); DATAS_NO_PERIODO(dia; ULTIMA_DATA(dia); -3; "MES")) → 470Expected 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").