Power BI Matrix Visual Conditional Formatting

Have you ever tried applying conditional formatting to your Power BI Matrix visual? That makes your data more engaging and easier to understand.

You can add background colors, font colors, data bars, icons, or web links to your matrix visualization to highlight the data.

In this tutorial, I will explain how to apply conditional formatting to a matrix visual in Power BI. I have different examples on Matrix visual formatting, such as:

  • Format Background color in Power BI Matrix visual
  • Format Font Color in Power BI Matrix Visualization
  • Applying Data Bars Conditional Formatting to Power BI Matrix
  • Power BI Matrix Conditional Formatting with Icons
  • Applying Conditional Formatting with Web URL to Power BI Matrix

Have a look at the examples below!

Apply Conditional Formatting to Power BI Matrix [Background Color]

Here, I will show how to apply conditional formatting in the Power BI Matrix visual as a background color.

You can apply conditional formatting to any text or data field, as that field should contain numeric values, color names, hex code values, or web URL values.

I will explain this with an example below:

I have created a matrix visual with the ‘Sales’ data, where the Rows represent ‘Category‘, ‘Product‘, and ‘Store Type‘ fields, and the Values represent the ‘Sales Quantity‘.

Apply Conditional Table Formatting in Power BI

I wanted to apply conditional formatting with a background color to the sum of sales values if the values match the conditions below.

  • Sum of Sales Quantity >= 5 and less than 10 – Format with ‘Red’ color
  • Sum of Sales Quantity > 10 and less than 40 – Format with ‘Blue’ color
  • Sum of Sales Quantity >40 and less than 80 – Format with ‘Green’ color

Follow the steps below:

  1. On the Power BI Desktop, select the matrix visual and open the ‘Visualization‘ pane. Click on the Format icon. Click on the drop-down of ‘Cell elements‘.
Power BI Matrix Conditional formatting
  1. Next, expand the ‘Series‘ option and select the field that you want to format. Here, I was applying the format as a background color, so toggle on the Background color option. Then, click on the fx option to set the conditional formatting.
Conditional Formatting in a Matrix Power BI
  1. Then, the Background color dialog box opens, where you can apply the background color based on the Format style options. See the parameters below:
    • Format style: I have selected the Rules option.
    • Rules: Enter the values according to your requirement.

Click on the OK button.

Conditional Formatting a matrix Power BI
  1. Hereafter, you can see the conditional formatting applied to the Sum of sales quantity column in the screenshot below.
Power BI Matrix Visual Conditional Formatting

This is how you can apply conditional formatting to a matrix visual in Power BI.

Check out Hide or Remove Column Headers on Power BI Matrix Visual

Conditional Format Font Color in Power BI Matrix Visualization

This example demonstrates how to format the font color in a Power BI matrix table by applying conditional formatting.

I have created a matrix visual as shown in the image below. Within the matrix table, I wanted to format the font color so that if the status is ‘Profit‘, the text should be in ‘Green‘. If the status is ‘Loss‘, the text should be in ‘Red‘.

Power BI conditional formatting text

Here are the steps to follow:

  1. Select the Matrix visual -> Go to ‘Visualization’ pane and click on Format visual icon, expand the ‘Cell elements‘. Then, select ‘Status’ in the series option. Toggle on the Font color button.
Power BI matrix conditional formatting font color
  1. On the Font color window, select the Format style as ‘Rules‘ and Apply to Values and totals option along with the below provided rules.
    • If the value is Profit -> Green
    • If the value is Loss -> Red

Then, click the Ok button.

Power BI conditional formatting based on text

The changes will be applied, formatting the text color based on the status value.

Output:

Conditional Formatting a matrix in Power BI

This is how to format the matrix visual with font color using conditional formatting in Power BI.

Apply Data Bars Conditional Formatting in Power BI Matrix Visual

Let me show you how to apply data bars within the matrix visual in Power BI.

The matrix visual presented below shows the ‘Sales Quantity‘ values. I wanted to format these values as data bars by applying conditional formatting to them.

Add Conditional formatting in Power BI Matrix

Data bars provide a visual representation of values directly within the Matrix table, which makes it easy to compare. The length of the bar corresponds to the value present in the matrix table.

Go through the steps to add data bars to the Power BI matrix visual:

  1. On the Report canvas of Power BI desktop, select the Matrix visual -> Go to ‘Visualization’ pane and click on Format visual icon, expand the ‘Cell elements‘. Then, select ‘Sales Quantity‘ in the series option. Toggle on the Data bars button. Click on the fx option.
Microsoft Power BI matrix conditional formatting
  1. On the Data bars window, you can set the Minimum and Maximum values for a bar by selecting the Lowest and Highest values—the length of the bars will depend on the values provided. We can also set different colors for positive bars and negative bars.
    • Positive bar: Pick a suitable color from the drop-down.
    • Negative bar: Select a color from the drop-down menu.

Then, click the OK button.

Power BI Conditional Formatting matrix
  1. Then the data bars will be populated on the Power matrix visual. Have a look at the reference image.
Power BI Matrix Conditional format as data bars

You can also display only the data bars without any values by selecting the “Show bar only” checkbox at the bottom. By default, it will be unchecked.

Power BI Conditional Formatting for Matrix

Output: Databars without values

Conditional formatting data bars in matrix Power BI

This way, you can apply conditional formatting to the Power BI matrix visual by using data bars.

Power BI Matrix: Apply Conditional Formatting with Icons

Now, let’s see how to apply icon formatting to the matrix visual in Power BI.

I have a Matrix visual with ‘Sum of Sales 2024‘ that displays the values, as shown in the image below.

Power BI Matrix format with Icon

Now, I wanted to apply formatting as icons based on the values corresponding to the ‘Status’ value.

  • If Status is Profit -> Green Arrow Icon showing upwards
  • f Status is Loss -> Red Arrow Icon showing downwards

Follow the same steps as those given in the previous examples, but modify only the formatting styles.

See the steps:

  1. Expand the ‘Cell elements’ of the Format pane. Then, select ‘Sum of sales 2024‘ in the series option. Toggle on the Icons button.
Apply Icons format to Power BI Matrix
  1. Then, the icons will be added by default based on the value in the selected column.
Power BI Matrix Conditional Formatting with Icons

If you want, you can also change the icon format by selecting the custom icons from the Icons window. Click on the fx option.

  1. Then, the icon window box opens. Select ‘Format style’ as ‘Rules‘ and ‘What field should we base this on?’ to ‘First Status‘, because I’m formatting based on the status value. Provide the Rules as shown in the image below and select icon styles. Then, click on OK.

We can set up 25 different pairs of icons.

Matrix conditional formatting with Icons Power BI
  1. The icons will be added based on the value in the ‘Status’ column. Have a look at the image below.
Power BI Matrix Apply Conditional Formatting with Icons

This way, you can add icons to the matrix visual in Power BI.

Power BI Matrix: Apply Conditional Formatting with Web URL

This example demonstrates how to apply web URL conditional formatting in the Power BI matrix visual.

To do this, I created a Power BI matrix visual, as shown in the image below, which includes ‘Website‘ and ‘Country‘ columns.

Power BI Conditional Format matrix on web url

Now, I wanted to apply a website URL to a Country value in the Matrix visual so that I can make the link clickable.

See the steps below:

  1. On the Power BI Desktop report canvas, select the Matrix visual -> expand the ‘Cell elements’. Then, select ‘Country‘ in the series option. Toggle on the ‘Web URL‘ button. Then, click on the fx option.
Power BI Matrix Table Web URL Formatting
  1. Then, the Web URL window box opens. Then, select What field should we base this on? Option to ‘Website‘ column where your URL is present.
Conditional Formatting with Web URLin Matrix Visual
  1. After that, you can see that the Country values will be displayed with the clickable links. Hover the mouse over a value in the Country column. Reference the image below.
Power BI Matrix Web Url Conditional Formatting

Following the above method, you add a URL to the matrix visual using the web URL conditional formatting.

I hope you have learnt how to apply conditional formatting to your Power BI matrix visual. This is also applicable to the Power BI table.

If you have any questions or suggestions regarding this, please mention them in the comment section below.

You may like the following Power BI visual tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…