How to Create a Heatmap in Power BI

Cody Schneider

Ever stared at a massive table of numbers and felt your eyes glaze over? You know there are valuable insights hiding in there, but identifying them feels like a chore. This is where a heatmap comes in handy. It’s a powerful visualization that uses color to instantly show you the bright spots and dead zones in your data, turning a bland spreadsheet into a clear story. This guide will walk you through exactly how to create a useful heatmap in Power BI, step by step.

What Exactly Is a Heatmap (and Why Should You Care)?

Think of a heatmap like a weather map for your data. Just as a meteorologist uses shades of red and blue to show hot and cold temperature zones, a data heatmap uses a color gradient to represent the intensity of a particular metric. Darker colors might show high activity (like peak sales hours), while lighter colors show low activity. It's a simple but incredibly effective way to spot patterns, outliers, and areas of interest at a single glance.

For anyone in marketing, sales, or e-commerce, heatmaps are a fantastic tool. You can use them to answer questions like:

  • What are our busiest sales hours of the day and days of the week?

  • Which marketing channels are performing best during specific campaigns?

  • Are certain products more popular at different times of the year?

  • Where are customers clicking most on our website homepage?

By translating raw numbers into a visual grid, you can make faster, more informed decisions without getting lost in endless rows and columns of data.

Before You Build: Getting Your Data in Shape

The secret to a great Power BI report is always good data preparation. For a heatmap to work correctly, you need your data structured in a specific way. At a minimum, your dataset needs three components:

  1. A Category for Your Rows (Y-Axis): This could be something like the hour of the day, a product category, or a sales rep's name.

  2. A Category for Your Columns (X-Axis): This is often a time-based dimension, like the day of the week, the month, or a specific marketing campaign.

  3. A Numerical Value for the "Heat": This is the metric you want to measure, like the number of sales, website sessions, or support tickets created.

Let's imagine you run an online store and want to see your busiest hours. Your raw data might look something like this simple table:

Order ID

Timestamp

Sales Amount

1001

2023-11-20 09:15:00

$50

1002

2023-11-20 09:30:00

$75

1003

2023-11-20 14:05:00

$25

1004

2023-11-21 11:45:00

$120

...and so on.

To use this in a heatmap, you'd need to add two new columns in Power BI's Power Query Editor or using DAX: one that extracts the "Hour" (e.g., 9, 14, 11) from the timestamp and another that extracts the "Day of the Week" (e.g., Monday, Tuesday). Once you have those categories, you’re ready to build.

How to Create a Heatmap in Power BI, Step-by-Step

Power BI doesn't have a single-click "Heatmap" button in its standard visualizations. Instead, we cleverly create one by using the Matrix visual and applying some conditional formatting. Don’t worry, it's easier than it sounds.

Step 1: Select the Matrix Visual

First, open your Power BI report. In the Visualizations pane on the right-hand side, click on the icon for the Matrix visual. This will add an empty matrix to your report canvas.

Step 2: Assign Your Data Fields

Now, let's populate the matrix. Using our e-commerce sales example, we’ll drag and drop our data fields from the Data pane into the appropriate slots in the Visualizations pane:

  • Drag your "Day of the Week" field into the Columns well.

  • Drag your "Hour of the Day" field into the Rows well.

  • Drag your "Sales Amount" field into the Values well. If you want to count transactions instead, an "Order ID" field set to "Count (Distinct)" would work perfectly here.

At this point, you'll have a standard table with numbers. It's functional, but not very insightful. The next step is where a little magic happens.

Step 3: Apply Conditional Formatting for the "Heat"

This is the key to turning your matrix into a true heatmap. With your matrix visual selected, go back to the Visualizations pane and click the "Format your visual" icon (it looks like a paintbrush).

  1. Scroll down and expand the Cell elements section.

  2. Find the Background color option and toggle it to On. This will open the formatting options.

By default, Power BI applies a light blue color gradient, and you'll immediately see your matrix transform. The cells with higher values will be darker blue, and those with lower values will be lighter blue.

Step 4: Customize Your Color Scale

A blue or green theme works well, but you can customize the colors to fit your needs or brand. Click the fx button next to the "Background color" toggle to open the advanced settings.

In this window, you can:

  • Change the gradient colors: Set a custom color for the Lowest value and Highest value. A common heatmap combination is a light grey or yellow for low values and a dark red or green for high values.

  • Add a middle color: Click "Add a middle color" to create a diverging palette, which is great for showing values that fall on either side of a central point (like profit and loss).

  • Set rules instead of a gradient: You can switch from a gradient to "Rules" to set specific colors for specific value ranges (e.g., if value is > 1000, then red). For a classic heatmap, the gradient is almost always the better choice.

Step 5: Tidy Up Your Visual

Your heatmap is technically complete, but a few quick formatting tweaks will make it much cleaner and easier to read.

  • Remove Totals: In the "Format your visual" tab, find the Row subtotals and Column subtotals sections and toggle them both to Off. The heatmap is for spotting patterns, not summing figures, so these totals just add clutter.

  • Adjust Column Width: Go to Column headers, expand the Options menu, and turn off Auto-size width so you can manually make the columns a bit wider or narrower for a better grid-like appearance. You can often do the same for row height under Grid settings.

  • Hide the Text: For a pure heatmap effect, you can make the numbers disappear. Staying in the Cell elements section, do the same thing for Font color that you did for the background. Set the font color to the same gradient as the background color. The numbers will still be there for tooltips, but the visual will just show the colors. This is an advanced trick for when the pattern is all that matters.

Alternative Method: Using a Custom Heatmap Visual

While the matrix method works for 95% of use cases, you can also find dedicated heatmap visuals in Microsoft AppSource. To do this, click the three dots (...) at the bottom of the Visualizations pane and select "Get more visuals." Search for "heatmap" and you'll find a few options you can add to your Power BI. These often provide more specific formatting options but also add another dependency to your report. For most situations, mastering the matrix method is more than enough.

Final Thoughts

Creating a heatmap in Power BI is a fantastic skill that transforms dense data into an intuitive, visual story. By using the humble Matrix visual and adding a layer of smart conditional formatting, you can quickly identify the patterns, peaks, and valleys in your business data without being a data scientist.

While Power BI is a powerful tool, it does require a learning curve and manual setup. For teams that need to connect multiple data sources - like Google Analytics, Shopify, Facebook Ads, and Salesforce - and get answers without spending hours in a complex interface, we built Graphed. You can just ask questions in plain English like, "show me a heatmap of sales by day and hour for the last 90 days," and it instantly generates a real-time, shareable dashboard for you, saving you from all the manual clicks and data prep.