Power BI How-To

How to make a heatmap in Power BI

Build a heatmap in Power BI: field wells, a worked example, when the native visual is enough, and how to generate the .pbiviz without code.

By · Founder & Reliability Engineer · Updated

A heatmap is the chart for 'where are the hot spots?' across two categories: hour of day by weekday, product by region, metric by metric. Each cell's colour carries the value, so a reader scans a 7 × 24 grid in a second where a table of 168 numbers would take a minute.

Power BI users usually start with the matrix visual and background-colour conditional formatting. That works until you need a real colour scale with a legend, square cells, hover values on an empty grid, or axis labels that don't wrap. This guide shows the three-column data shape a true heatmap needs, how to build the grid in DAX when your data is sparse, and what to check when the colour scale looks wrong.

Step-by-step

  1. 1

    Shape the data for the heatmap

    Three columns: RowCategory (text or number), ColumnCategory (text or number), Value (numeric). Each row is one cell. Empty cells can be left out or explicitly zero. In the finished visual those columns land in the Rows, Columns, Value wells, so name them that way from the start.

  2. 2

    Load a small sample into Power BI Desktop

    Import a week of sessions with all 24 hours for every weekday, not just the six sample cells. A sparse sample leaves blank cells that look like a colour-scale problem when they are only missing rows.

  3. 3

    Describe the heatmap and generate the .pbiviz

    On VizForge, describe the chart in plain English and say what matters for this one: sequential (one hue, light to dark) or diverging (two hues around a midpoint) colour scale, and the midpoint value if diverging; whether empty cells should be drawn (grey or white) or left out; cell labels: always, only above a cell-size threshold, or never. The pipeline writes the TypeScript, type-checks it and packages a .pbiviz.

  4. 4

    Import the .pbiviz into Power BI Desktop

    In the Visualizations pane, open the three-dot menu, choose Import a visual from a file and select the .pbiviz. The visual appears in the gallery; add it to the page like any built-in chart.

  5. 5

    Bind the field wells

    Rows: Text or number column: the Y axis (Hour 0–23, Product). Columns: Text or number column: the X axis (Weekday, Region). Value: Numeric measure: the colour of the cell.

  6. 6

    Check the first render, then format

    Weekdays in alphabetical order: set 'Sort by column' on Weekday to a weekday-number column. A washed-out grid: one outlier cell owns the top of the scale. Fix the scale maximum in the formatting pane or cap the measure. Then open the formatting pane and set colour scale endpoints (min, mid, max colours) and whether the scale is fixed or auto from the data.

Field wells the generated heatmap exposes

After import, these are the data roles you drop fields into. The names come from the visual’s capabilities.json, which you can rename before packaging if your team uses different terms.

WellTakesNote
RowsText or number column: the Y axis (Hour 0–23, Product).Sort order comes from the column's own sort; set 'Sort by column' for weekday names.
ColumnsText or number column: the X axis (Weekday, Region).Keep it under about 30 values or the cells become slivers.
ValueNumeric measure: the colour of the cell.Use a measure so empty cells are genuinely empty, not zero.

Worked example

Website sessions by hour and weekday (a slice of the grid).

HourWeekdaySessions
9Mon1,240
9Sat310
13Mon1,980
13Sat720
21Mon640
21Sat1,150

What the chart draws: A grid with 24 rows and 7 columns. Monday's hot band sits at 13:00; Saturday's shifts to the evening, which is the pattern a line chart per weekday hides behind seven overlapping lines.

Live preview

Live preview · sample dataDownload sample data (CSV) ↓
08016024032052Auth78Search120Checkout140Catalog155Payments
API response time (ms) by service — box plots expose the spread and tail, not just the average. Rendered live from sample data — your generated visual uses your own model.

The AI alternative: Describe your heatmap in plain English and VizForge generates the .pbiviz, source included. 5 free credits on signup, no card required.

Generate a heatmap on VizForge →

Without code: what to put in the prompt

The generator turns a description into the TypeScript, so the description is where the decisions live. For a heatmap, say:

  • Sequential (one hue, light to dark) or diverging (two hues around a midpoint) colour scale, and the midpoint value if diverging.
  • Whether empty cells should be drawn (grey or white) or left out.
  • Cell labels: always, only above a cell-size threshold, or never.
  • Square cells or stretch-to-fit.
  • Hover tooltip content: the row, column and value, plus any extra measures.

Example VizForge prompt

Heatmap of website traffic by hour-of-day (Y axis, 0-23) and day-of-week (X axis, Mon-Sun). Use a sequential blue color scale, white for zero, display counts on hover.

Customise it: formatting options worth exposing

Anything you name as adjustable becomes a card in Power BI’s formatting pane, which a report theme can then set for every copy of the visual. For a heatmap the options that earn their place are:

  • Colour scale endpoints (min, mid, max colours) and whether the scale is fixed or auto from the data.
  • Legend position and whether it shows a gradient bar or discrete bins.
  • Cell gap and corner radius.
  • Label font size and the minimum cell size that still shows a label.
  • Axis label rotation for long column names.

For changes the pane doesn’t cover, edit settings.ts and visual.ts in the source that ships with the download and repackage; or refine on VizForge and get a v2 that keeps everything you didn’t mention.

When native Power BI is enough (as of November 2026)

The matrix visual with background-colour conditional formatting is a usable heatmap when your grid is small, your categories are text and you don't need a legend: it is governed, exportable to Excel and needs no import. It stops being enough when you want a continuous legend, square or sized cells, a diverging scale with a fixed midpoint, or hover values on cells that have no data. Power BI has no native heatmap visual as such.

Limits of Marketplace heatmap visuals

Marketplace heatmaps bring their own palettes and often don't let a report theme set the scale colours, so brand compliance means hand-editing every instance. Empty-cell handling (draw, hide, treat as zero) is fixed by the vendor, and so is the maximum grid size. Some of the better-known ones are free; the ones with a proper legend and labels are frequently paid per user.

The general trade-offs (per-user licensing, closed source, no new field wells) are the same for every chart type; see VizForge vs Microsoft Marketplace visuals for the full comparison.

Download, install and first render

The download is a standard .pbiviz plus the TypeScript source. Import it in Power BI Desktop (Visualizations pane → three dots → Import a visual from a file), add it to the page and bind the wells above. Then check the heatmap against this list before you connect the full dataset:

  • Weekdays in alphabetical order: set 'Sort by column' on Weekday to a weekday-number column.
  • A washed-out grid: one outlier cell owns the top of the scale. Fix the scale maximum in the formatting pane or cap the measure.
  • Missing cells: the measure returns BLANK for combinations with no rows, which is correct. Draw them grey or wrap the measure in COALESCE if zero is meaningful.
  • Labels overlapping: raise the minimum cell size for labels rather than shrinking the font.

When to use a heatmap

  • Hour-of-day × day-of-week traffic or activity patterns
  • Correlation matrix between dozens of numeric metrics
  • Geographic density (state × metric, region × product)
  • Cohort retention grids (signup month × months-since-signup)
  • Sensor telemetry by location × time bucket

Frequently asked questions

Will the visual work in Power BI Service, Premium and embedded reports?

Yes. A .pbiviz is a standard Power BI custom visual and renders the same in Desktop, the Service, Premium and Premium per User capacities, and embedded scenarios. Tenant admins can restrict custom visuals to certified or organisational ones; if yours does, publish the .pbiviz as an organisational visual rather than importing it per report.

What if I need to change the visual later?

Two paths. Refine on VizForge with an instruction such as "add a target line" and get a v2 .pbiviz that keeps everything you didn't mention; or open the TypeScript source that ships with every download in VS Code, edit it and repackage with pbiviz package.

Diverging or sequential color scale?

Both. Prompt VizForge with your preference — diverging (red-white-blue) for signed deltas, sequential (one-hue gradient) for counts. The formatting pane lets you swap scales after generation.

Can I show the value in each cell?

Yes. Turn on the 'Cell labels' switch in the formatting pane, or request it in the prompt. For dense grids, VizForge auto-hides labels below a configurable cell-size threshold.

How large can the grid be?

Up to Power BI's data-reduction cap (typically 30,000 cells). For larger grids, pre-aggregate or bin your categories in DAX.

Will it respect the report theme?

Partially — color scales are explicitly specified since themes don't define divergent palettes. Text and borders follow the active theme.

Put your heatmap on a designed page

Free Design Studio page layouts. Download the background, theme and PBIP project, then import the visual into the slot.

Design the page around it, free

A custom visual looks best on a designed page. The free VizForge Design Studio lays out a branded report page at Power BI’s pixel size and exports the background image, a theme JSON and a PBIP project. No signup.

Open the free Design Studio →

Guides for related charts

VizForge — AI-generated Power BI custom visuals.

Make the report.
Then make it yours.

The Design Studio, templates and tools are free with no account (exports carry a small VizForge mark until you sign in). Sign up when you want AI: 5 credits on us, no card.

Generated visuals are type-checked and built before you download them; one that fails the quality SLA refunds its credits. See all features or pricing.