Forum Discussion

mathmontibeler's avatar
mathmontibeler
New Member
2 days ago

Horizontal Conditional Formatting in a Matrix

Good afternoon, everyone!

I'm having some difficulty implementing conditional formatting (heat map style) horizontally in a Power BI matrix.

By default, Power BI seems to calculate the heat map by column, but I need to clearly highlight when a specific product's volume (number of opinions) is increasing or decreasing over time.

My matrix is structured as follows:

Rows: Product
Columns: Month/Year
Values: Number of Opinions

What I need is a horizontal heat map, meaning I want to compare each product's values across time.

In this scenario, I'd like the color intensity to be calculated within each row, so that it's easy to see whether the volume for a given product is trending upward or downward throughout the months. However, the standard conditional formatting appears to calculate the color scale across the entire column, comparing products against each other for a given month.

Is there a way to make the color scale be calculated per row (product) instead of per column (month)?

Thank you in advance for any suggestions!

1 Reply

  • Power BI's built-in color scale conditional formatting always uses a single global min/max across the whole matrix for that measure — there's no native row-vs-column toggle, so what you're seeing isn't a bug, it's just how the feature works.

    The standard workaround is to stop coloring the raw measure and instead color a second, computed measure that's already row-relative. Something like: Row Relative = DIVIDE([Number of Opinions], CALCULATE(MAX(Table[Number of Opinions]), ALLSELECTED('Date'[Month/Year]))) — this divides each cell by the max value in that same product's row across all the months currently in view, giving you a 0–1 value that's naturally normalized per row.

    Then in the matrix's conditional formatting, set 'Format by: Field value' and point the color scale at this new measure instead of at Number of Opinions directly, while still displaying Number of Opinions as the visible value. Each row will now color relative to its own trend instead of competing against every other product for the same month.

    One caveat: ALLSELECTED needs to match whatever field is actually driving your matrix columns (swap 'Date'[Month/Year] for your real column field), and this approach assumes each row has at least one non-blank value to divide by.