cd /news/data/tabla-calendario-en-dax-power-bi · home topics data article
[ARTICLE · art-10242] src=gist.github.com ↗ pub= topic=data verified=true sentiment=· neutral

Tabla Calendario en DAX - Power BI

This article provides a DAX script for creating a reusable calendar table in Power BI. The script generates common time-intelligence columns such as Year, Month, Quarter, and Week, using the `CALENDAR` and `ADDCOLUMNS` functions. Users are instructed to paste the code into Power BI's "New Table" option and adjust the table and date column references to match their own data.

read1 min views26 publishedMay 21, 2026

gistfile1.txt

  This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.

Learn more about bidirectional Unicode characters

Show hidden characters
// --------------------------------------------------------------------------

/*

Tabla Calendario en DAX - Power BI

Crear una tabla de dimensión temporal reutilizable en DAX.

El script genera columnas de tiempo: Año, Mes, Día, Trimestre, Semana, Semestre,

Período (YYYYMM), Inicio/Fin de Mes, y más.

Uso:

  1. Power BI → Vista de Modelo → Nueva tabla

  2. Pega el código

  3. Cambia fact_sales_denormalized y sales_date por tu tabla/columna. Dale enter.

  4. Relaciona los campos de fecha

Siéntete libre de adaptarlo. Si tienes sugerencias, avísame.

*/

// --------------------------------------------------------------------------

Calendario =

ADDCOLUMNS(

    CALENDAR(

        MIN(fact_sales_denormalized[sales_date]),

        MAX(fact_sales_denormalized[sales_date])

    ),

    "Año", YEAR([Date]),

    "Número Mes", MONTH([Date]),

    "Mes", FORMAT([Date], "MMMM"),

	"Mes Corto", FORMAT([Date], "MMM"),

    "Día", DAY([Date]),

    "Día de la Semana", FORMAT([Date], "dddd"),

	"Día de la Semana Corto", FORMAT([Date], "ddd"),

    "Número Día Semana", WEEKDAY([Date], 2),

    "Periodo", YEAR([Date]) * 100 + MONTH([Date]),

    "Inicio Mes", DATE(YEAR([Date]), MONTH([Date]), 1),

    "Fin Mes", EOMONTH([Date], 0),

    "Trimestre", "Q" & FORMAT([Date], "Q"),

    "Semana del Año", WEEKNUM([Date], 2),

    "Semestre", IF(MONTH([Date]) <= 6, 1, 2)

)
── more in #data 4 stories · sorted by recency
── more on @power bi 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/tabla-calendario-en-…] indexed:0 read:1min 2026-05-21 ·