The measure over the ENTIRE PREVIOUS MONTH (not the group's range shifted).
| Field | Value |
|---|---|
| Category | Date and time |
| Type | Aggregation (operates on a set of rows) |
| Arity | 2 arguments (fixed) |
| Compiles to SQL (calculated column) | No |
| Version | Formula engine v3, with fiscal/4-4-5 calendar support. |
Aliases#
Canonical name: MES_ANTERIOR. Accepted aliases (case-insensitive): previousmonth.
Syntax#
MES_ANTERIOR(expr; arg2)All arguments are expressions.
Returns#
The measure's value in the previous month, or blank.
Null handling#
Invalid or missing dates become a friendly error or blank, depending on the function.
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: PREVIOUSMONTH
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: ENTIRE previous month over the visual's rows; returns blank when there's no data.
Examples#
MES_ANTERIOR(SOMA(receita); dia)Example with values#
Input: group March/25 → February/25 (70).
MES_ANTERIOR(SOMA(receita); dia) → 70Expected result: 70
Business example#
Change versus the previous month (MoM).
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.