The calendar table is the model's time dimension. Without it, functions such as "year to date" (YTD) and "same period last year" have nothing to operate on. This tutorial shows how to set it up, including the fiscal year, the retail 4-4-5 calendar, the time zone and the pt-BR locale.
Example workspace: Comércio Aurora Ltda (aurora).
Why a dedicated time dimension#
A date column in the fact table is enough to filter, but it doesn't know what a "quarter",
a "fiscal year" or "the same week last year" is. The calendario dimension brings those
attributes ready to use and is what time intelligence uses as its axis — see
Row and filter context.
Prerequisites#
- A model with the fact table linked to a date column (see Tutorial: star schema).
- A
calendariotable (or its generation) with one row per day in the period.
Step by step#
Link the calendar to the fact table
Make sure the relationship
vendas.data→calendario.data(N-1, single) exists.Set the time zone
Configure the calendar's time zone (default
America/Sao_Paulo). The engine works with the civil date, not UTC — a sale at 10 p.m. on 12/31 stays in the correct calendar year instead of "leaking" into the next year.Choose the locale
Select pt-BR for month/day names in Portuguese (the locale table is fixed, to guarantee identical bytes between the engine and SQL).
(Optional) Fiscal year
If your company doesn't close its year in December, set the starting month (e.g., April). The fiscal year is labeled by the calendar year in which it starts.
(Optional) Retail 4-4-5
Turn on 4-4-5 mode if you close in weeks ("closest"/NRF rule; the 53rd week goes entirely to the last period).
Validate
Create a "revenue by period" visual and check that the years/periods are cut according to your configuration.
Example: fiscal year starting in April#
With the fiscal year starting on 04/01, fiscal year 2026 covers 04/01/2026 → 03/31/2027. A "revenue by fiscal year" visual groups July 2026 and March 2027 into the same fiscal year 2026.
Expected result#
- Year/quarter/month/week axes available for any measure.
- YTD and time comparisons start working (see Tutorial: measures and time comparisons).
- A sale on 12/31 at 10 p.m. (São Paulo time zone) falls into the correct civil year/period.
Limits and caveats#
- The locale comes from a fixed table (not from
Intl), to guarantee identical bytes between the pure engine and SQL; a new language requires a new table. - Sorting months by number (rather than alphabetically) uses sort-by-column — see Semantic model.
Related#
Last reviewed: 2026-09-08.