Esta página también está en español. Leer en español →

Calendar Heatmap

Calendar heatmap with Deneb: a full year in 53 weeks × 7 days to see the daily pattern. It needs just one date column.

💡 When to use it

When the question is *when*, not *how much*: weekly seasonality, streaks, gaps, campaign effects. Needs DAILY grain and at least a year for the pattern to show. With only monthly aggregates a line chart tells it better.

Vega-Lite calendar-heatmap ✓ Cross-filter✓ Tooltip✓ Context menu✓ Selection

Live preview

Rendered with sample data · Vega/Vega-Lite

The hover highlight runs LIVE here on the web. Dimming through __selected__ is the other half: Power BI turns it on when another visual filters this one, although the gallery simulates the click in the view itself.

Calendar Heatmap Loading preview…

Preview rendered with the runtime of Deneb · MIT © Daniel Marsh-Patrick

The sample data and the chart's own titles stay as they ship in the spec.

🔽 Download (PBIP, Spanish labels) 🔽 Download spec .json

🧩 Fields it expects

  1. __0__ Date dateTime
  2. __1__ Total Sales number measure

Drag your fields into Values in this order.

🎯 Technique

Engine
Vega-Lite 6.4.1
Marks
rect

🛠️ How it is built

Each cell is one day and its colour is the measure's intensity. What you read at a glance is the pattern, not the total: which weekdays concentrate, where the season sits and, where they exist, days with no activity. The spec derives the calendar itself from a single date column via timeUnit, with no helper columns in the model.

How to use it in Power BI

  1. Add the Deneb visual to your report and open its editor.
  2. Drag your fields into Values in this order: Date , Total Sales .
  3. Paste the spec (the «Copy spec» button above) into Deneb's JSON editor.
  4. Map your columns and adjust it to taste. The native interactivity is already set up.
See the full spec: Vega-Lite
spec.vega-lite.json
{
  "$schema": "https://vega.github.io/schema/vega-lite/v6.json",
  "description": "Cada celda es un día y su color es la intensidad de la medida: el año entero cabe en una rejilla de 53 semanas × 7 días. Lo que se lee de un vistazo no es el total sino el PATRÓN — qué días de la semana concentran, dónde hay temporada y, si los hay, los días sin actividad. Por CSalcedoDataBI · https://csalcedodatabi.com/deneb/calendar-heatmap",
  "usermeta": {
    "information": {
      "uuid": "18acb70c-63dc-4420-a900-3509f8e6371c",
      "generated": "2026-08-12T03:57:31.488Z",
      "previewImageBase64PNG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
      "name": "Mapa de calor de calendario",
      "description": "Rejilla de 53 semanas × 7 días por año. El calendario se deriva dentro del spec con timeUnit UTC a partir de UNA columna de fecha. Autor: Cristobal Salcedo Beltrán.",
      "author": "Cristobal Salcedo Beltrán"
    },
    "deneb": {
      "build": "1.9.1.0",
      "metaVersion": 1,
      "provider": "vegaLite",
      "providerVersion": "6.4.1"
    },
    "interactivity": {
      "tooltip": true,
      "contextMenu": true,
      "selection": true,
      "selectionMode": "simple",
      "highlight": true,
      "dataPointLimit": 250
    },
    "config": "{\n  \"background\": \"transparent\",\n  \"font\": \"Segoe UI\",\n  \"view\": {\n    \"stroke\": \"transparent\"\n  },\n  \"axis\": {\n    \"grid\": false,\n    \"domain\": false,\n    \"ticks\": false,\n    \"labelColor\": \"#605E5C\",\n    \"labelFontSize\": 11,\n    \"titleColor\": \"#252423\",\n    \"titleFontWeight\": \"normal\"\n  },\n  \"text\": {\n    \"font\": \"Segoe UI\"\n  }\n}",
    "dataset": [
      {
        "key": "__0__",
        "name": "Date",
        "description": "Fecha a grano DÍA. Una fila por día — el spec no agrega",
        "kind": "column",
        "type": "dateTime"
      },
      {
        "key": "__1__",
        "name": "Total Sales",
        "description": "Medida cuya intensidad pinta cada día",
        "kind": "measure",
        "type": "numeric"
      }
    ]
  },
  "config": {
    "background": "transparent",
    "font": "Segoe UI",
    "view": {
      "stroke": "transparent"
    },
    "axis": {
      "grid": false,
      "domain": false,
      "ticks": false,
      "labelColor": "#605E5C",
      "labelFontSize": 11,
      "titleColor": "#252423",
      "titleFontWeight": "normal"
    },
    "text": {
      "font": "Segoe UI"
    }
  },
  "title": {
    "text": "Intensidad de ventas día a día · 2023–2024",
    "subtitle": [
      "Cada celda es un día · color = ventas del día",
      "Contoso Retail · el sábado vende 5× lo del domingo"
    ],
    "anchor": "middle",
    "font": "Segoe UI",
    "fontSize": 21,
    "fontWeight": 600,
    "color": "#1B1A19",
    "subtitleFont": "Segoe UI",
    "subtitleFontSize": 12,
    "subtitleFontWeight": "normal",
    "subtitleColor": "#8A8886",
    "subtitleLineHeight": 17,
    "subtitlePadding": 10,
    "offset": 20
  },
  "padding": {
    "left": 4,
    "top": 4,
    "bottom": 4,
    "right": 12
  },
  "data": {
    "name": "dataset"
  },
  "spacing": 22,
  "mark": {
    "type": "rect",
    "cornerRadius": 2,
    "stroke": "#FFFFFF",
    "strokeWidth": 1.5
  },
  "encoding": {
    "row": {
      "field": "__0__",
      "timeUnit": "utcyear",
      "type": "ordinal",
      "title": null,
      "header": {
        "labelExpr": "utcFormat(datum.value, '%Y')",
        "labelAngle": 0,
        "labelAlign": "left",
        "labelAnchor": "start",
        "labelOrient": "top",
        "labelPadding": 2,
        "labelFontSize": 13,
        "labelFontWeight": 600,
        "labelColor": "#3B3A39"
      }
    },
    "x": {
      "field": "__0__",
      "timeUnit": "utcweek",
      "type": "ordinal",
      "title": null,
      "axis": {
        "labelExpr": "utcdate(datum.value) <= 7 ? utcFormat(datum.value, '%b') : ''",
        "labelAngle": 0,
        "labelPadding": 6,
        "labelFontSize": 11,
        "orient": "bottom"
      }
    },
    "y": {
      "field": "__0__",
      "timeUnit": "utcday",
      "type": "ordinal",
      "title": null,
      "axis": {
        "labelExpr": "['D', 'L', 'M', 'X', 'J', 'V', 'S'][utcday(datum.value)]",
        "labelPadding": 6,
        "labelFontSize": 11,
        "labelFontWeight": 600,
        "labelColor": "#3B3A39"
      }
    },
    "color": {
      "condition": {
        "test": "datum['__1__'] === 0",
        "value": "#E8E6E3"
      },
      "field": "__1__",
      "type": "quantitative",
      "title": null,
      "scale": {
        "type": "linear",
        "range": [
          "#9EF1E0",
          "#72EBC4",
          "#68C98F",
          "#388E84",
          "#116B62",
          "#084F49"
        ]
      },
      "legend": {
        "orient": "right",
        "direction": "vertical",
        "gradientLength": 118,
        "gradientThickness": 8,
        "labelFontSize": 10.5,
        "labelColor": "#605E5C",
        "format": "~s",
        "offset": 10
      }
    },
    "opacity": {
      "condition": [
        {
          "test": "datum.__selected__ === 'off'",
          "value": 0.15
        }
      ],
      "value": 1
    },
    "tooltip": [
      {
        "field": "diaLargo",
        "type": "nominal",
        "title": "Día"
      },
      {
        "field": "__1__",
        "type": "quantitative",
        "title": "Ventas",
        "format": ",.0f"
      }
    ]
  },
  "width": 1040,
  "height": 150,
  "transform": [
    {
      "calculate": "['domingo','lunes','martes','miércoles','jueves','viernes','sábado'][utcday(toDate(datum['__0__']))] + ', ' + utcdate(toDate(datum['__0__'])) + ' de ' + ['enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre'][utcmonth(toDate(datum['__0__']))] + ' de ' + utcyear(toDate(datum['__0__']))",
      "as": "diaLargo"
    }
  ]
}
Get in touch!