How to Add Conditional Formatting in Power BI (2026 Guide)

A table full of numbers is hard to read. Conditional formatting fixes that by coloring, highlighting, or tagging values automatically, so readers can spot problems right away. With it, a sales manager in Chicago can see underperforming states without reading every row.

This guide covers every type of conditional formatting in Power BI Desktop: background color, font color, data bars, icons, and web URLs, plus the three format styles (Gradient, Rules, and Field value). The examples use one simple US retail sales dataset throughout.

How to Add Conditional Formatting in Power BI6

If you’re new to Power BI, start with how to install and use Power BI Desktop, then come back here.

Table of Contents:

What Is Conditional Formatting in Power BI?

Conditional formatting changes how a value looks based on the value itself or on another field or measure. Instead of formatting cells one by one, you set a rule once, and Power BI applies it to every value. It updates automatically when filters, slicers, or data refreshes change the numbers.

Where Can You Use Conditional Formatting in Power BI?

VisualSupported formatting
Table and MatrixBackground color, font color, data bars, icons, web URL
Bar / Column chartsBar/column color
Line and Area chartsLine/marker color (limited), area fill
Card and KPICallout value color, title
GaugeFill color, target color
Pie / DonutSlice colors
Most visualsTitle text, title color, background (via fx)

The table and matrix visuals offer the most options, so most of this guide uses them.

Types of Conditional Formatting in Power BI

  1. Background color colors the entire cell.
  2. Font color colors the text only.
  3. Data bars draw an in-cell bar chart.
  4. Icons add symbols such as arrows, traffic lights, and flags.
  5. Web URL turns a value into a clickable link.

The Three Format Styles: Gradient vs. Rules vs. Field Value

Format styleBest forExample
GradientContinuous numbersRevenue from light to dark blue
RulesThresholds and bucketsMargin < 10% = red
Field valueFull control with DAXA measure returns “#1E8449”

Sample Dataset Used in This Tutorial

The examples use a simple US Sales table:

StateSales RepRevenue ($)Target ($)Profit Margin %
CaliforniaJohn Miller485,000450,00022%
TexasSarah Davis392,000420,00014%
New YorkMike Johnson410,000400,00018%
FloridaEmily Brown268,000300,0008%
IllinoisDavid Wilson215,000250,000-3%
OhioLisa Moore189,000180,00011%

Load it, then add a Table visual with all five columns. For help, see how to create a table in Power BI.

How to Add Conditional Formatting in Power BI (Colors, Data Bars, Icons & Rules)

How to Open Conditional Formatting in Power BI (2 Ways)

Let’s see the 2 ways to open conditional formatting in Power BI.

Method 1: From the Format Pane (Recommended)

  1. Select your table visual.
  2. In the Visualizations pane, click Format visual (the paintbrush icon).
  3. Expand Cell elements.
  4. Under Apply settings to, choose the column (series), for example Revenue.
  5. Turn on Background color, Font color, Data bars, Icons, or Web URL.
  6. Click the fx button to open the advanced settings.
How to Add Conditional Formatting in Power BI

Method 2: From the Field Well (Right-Click)

  1. In the Columns field well, click the dropdown arrow next to a field.
  2. Select Conditional formatting.
  3. Choose Background color, Font color, Data bars, Icons, or Web URL.
Add Conditional Formatting in Power BI (Colors, Data Bars, Icons & Rules)

Note: Conditional formatting only works on numeric fields or on fields you aggregate, such as Count or First. For text columns, use the Field value style with a DAX measure.

How to Add Background Color Conditional Formatting in Power BI

Background Color Using Gradient

Use this for a heat-map effect on the Revenue column.

  1. Go to Cell elements โ†’ Apply settings to: Revenue โ†’ turn on Background color โ†’ click fx.
  2. Format style: Gradient.
  3. What field should we base this on? Sum of Revenue.
  4. Minimum: Lowest value โ†’ choose a light color (#DEEBF7).
  5. Maximum: Highest value โ†’ choose a dark color (#2171B5).
  6. Optional: check Add a middle color for a three-color scale, such as red โ†’ yellow โ†’ green.
  7. Click OK.
Add Conditional Formatting in Power BI

California now shows the darkest blue and Ohio the lightest.

Add Conditional Formatting Power BI

Background Color Using Rules

Rules work best when your business has clear thresholds, like a margin target.

  1. Choose Apply settings to: Profit Margin % โ†’ Background color โ†’ fx.
  2. Format style: Rules.
  3. Add these rules:
If valueAndThen color
>= 0.20 (Number)<= 1 (Number)Green #C6EFCE
>= 0.10 (Number)< 0.20 (Number)Yellow #FFEB9C
>= -1 (Number)< 0.10 (Number)Red #FFC7CE
  1. Click OK.
How to Add Conditional Formatting in Power BI (Colors, Data Bars)

โš ๏ธ Common mistake: Number vs. Percent. In the rules dialog, Percent means a percentage of the column’s range (min to max), not the value itself. If your column stores 22% as 0.22, choose Number and enter 0.22.

Background Color Using Field Value (DAX Measure)

This is the most flexible method. Write a measure that returns a hex code or color name. If you need a refresher, read how to create a measure in Power BI.

Margin Color =
VAR Margin = SUM ( 'US Sales'[Profit Margin %] )
RETURN
    SWITCH (
        TRUE (),
        Margin >= 0.20, "#1E8449",
        Margin >= 0.10, "#F4D03F",
        "#C0392B"
    )
  1. Choose Background color โ†’ fx โ†’ Format style: Field value.
  2. What field should we base this on? Margin Color.
  3. Click OK.

The SWITCH(TRUE()) pattern is explained in depth in this Power BI SWITCH measure guide.

How to Add Conditional Formatting in Power BI (Colors, Icons & Rules)

How to Change Font Color Based on Value in Power BI

Font color uses the same dialog as background color. A classic use is red for below target, green for above target.

Target Font Color =
IF (
    SUM ( 'US Sales'[Revenue] ) >= SUM ( 'US Sales'[Target] ),
    "Green",
    "Red"
)
  1. Choose Apply settings to: Revenue โ†’ turn on Font color โ†’ fx.
  2. Format style: Field value โ†’ Target Font Color.
  3. Click OK.

Texas, Florida, and Illinois turn red because they missed target. For more patterns, see Power BI IF measure examples.

How to Add Conditional Formatting in Power BI (Colors)

Accessibility tip: About 1 in 12 American men has some form of color blindness. Don’t rely on red and green alone. Add icons or labels too.

How to Add Data Bars in Power BI

Data bars put a small bar chart inside each cell, which makes size comparisons easy.

Steps to Add Data Bars

  1. Choose Apply settings to: Revenue โ†’ turn on Data bars โ†’ fx.
  2. Configure these settings:
    • Minimum / Maximum: Lowest value / Highest value (or set a custom number).
    • Positive bar: blue (#4472C4).
    • Negative bar: red (#C0392B).
    • Axis: gray.
    • Bar direction: Left to right.
    • Show bar only: check this to hide the numbers.
  3. Click OK.
Power BI Add Conditional Formatting

Data Bars with Negative Values

The Profit Margin % column includes Illinois at -3%. Turn on data bars there, and Power BI draws an axis with the negative bar going left in red. This makes data bars great for variance and profit/loss columns.

Power BI Conditional Formatting in Power BI

Pro tip: Widen the column. Data bars on narrow columns are hard to read. See how to format a table visual in Power BI.

How to Add Icons in Power BI Conditional Formatting

Icons work like traffic lights in your report. Executives can scan them in seconds.

Add Icons Using Rules

  1. Choose Apply settings to: Profit Margin % โ†’ turn on Icons โ†’ fx.
  2. Format style: Rules.
  3. Icon layout: Left of data (or Right of data, or Icon only).
  4. Icon alignment: Middle.
  5. Style: pick a preset, such as 3 traffic lights or 3 arrows.
  6. Adjust the rules:
If valueAndIcon
>= 0.20<= 1๐ŸŸข Green circle
>= 0.10< 0.20๐ŸŸก Yellow circle
>= -1< 0.10๐Ÿ”ด Red diamond
  1. Click OK.
How to Add Conditional Formatting in Power BI image
Add some Conditional Formatting in Power BI

Show Icons Only (Hide the Number)

Set Icon layout to Icon only. This works well for “Status” columns on executive dashboards. If you’re building one, here’s how to create a dashboard in Power BI.

Icons Based on Another Measure (Target vs. Actual)

In What field should we base this on?, pick a different measure, such as a variance measure:

Revenue vs Target % =
DIVIDE (
    SUM ( 'US Sales'[Revenue] ) - SUM ( 'US Sales'[Target] ),
    SUM ( 'US Sales'[Target] )
)

Then set rules: โ‰ฅ 0 โ†’ up arrow, < 0 โ†’ down arrow. Learn more about DIVIDE in Power BI measures.

Power BI Conditional Formatting Complete Guide

How to Apply Conditional Formatting to Text Columns in Power BI

You can’t use Gradient or Rules on a text column directly, but Field value works on any column.

Rep Highlight =
IF (
    SELECTEDVALUE ( 'US Sales'[Sales Rep] ) = "John Miller",
    "#FFF2CC",
    BLANK ()
)

Apply it to the Sales Rep column as a background color with Field value. You can also use the Rules style on a text column by basing it on a numeric field, such as Sum of Revenue.

How to Format Data in Power BI

How to Add Conditional Formatting in a Power BI Matrix

A matrix works like a table, with one extra choice: Apply to.

  • Values only: formats the detail cells.
  • Values and totals: also formats subtotals and grand totals.
  • Totals only: formats only the totals.

Usually choose Values only. Totals are much larger and can throw off a gradient. For a full walkthrough, see Power BI matrix visual conditional formatting.

Power BI Conditional Formatting Step by Step

How to Add Conditional Formatting in Power BI Charts

Bar and Column Charts

  1. Select the chart โ†’ Format visual โ†’ Bars (or Columns) โ†’ Color โ†’ fx.
  2. Use Gradient, Rules, or Field value.

Important: The fx button is hidden when the chart has a field in Legend or uses multiple measures. Remove the legend to enable it.

Step-by-step guides:

Apply Conditional Formatting to Power BI Tables

Line, Area, Pie, and Gauge Charts

Each chart type has its own options and limits:

Cards and KPI Visuals

In a card, go to Callout value โ†’ Color โ†’ fx to make the big number turn red or green. Learn more about the Power BI card visual and Power BI KPI visual.

Dynamic Titles with Conditional Formatting

Click fx next to Title text and choose a measure:

Dynamic Title =
"Revenue by State โ€“ " & SELECTEDVALUE ( 'US Sales'[Sales Rep], "All Reps" )
Power BI Conditional Formatting for Beginners

How to Edit, Copy, or Remove Conditional Formatting in Power BI

  • Edit: Click fx again, or right-click the field โ†’ Conditional formatting.
  • Remove: Right-click the field โ†’ Remove conditional formatting โ†’ choose the type (or All). You can also just turn the toggle off.
  • Copy to other visuals: Use Format Painter on the Home ribbon. It copies most formatting between visuals of the same type.
  • Reuse colors: Store color logic in DAX measures. One measure can feed many visuals, so a color change only needs to be made once.

Power BI Conditional Formatting Best Practices

  1. Use 3 colors or fewer. More colors become noise.
  2. Keep meanings consistent. Green = good, red = bad on every page.
  3. Choose colorblind-safe palettes. Blue/orange works for more readers than red/green.
  4. Use DAX measures for business logic so thresholds live in one place.
  5. Handle blanks. In the dialog, set How should we format empty values? to Don’t format to avoid confusing colors.
  6. Exclude totals from gradients in a matrix.
  7. Test with slicers. Gradients recalculate based on visible data. See Power BI measures based on slicer.
  8. Don’t overdo it. If everything is highlighted, nothing stands out.

Troubleshooting: Power BI Conditional Formatting Not Working

ProblemFix
fx button missing on chartRemove the field from Legend, or use a single measure
Rules not coloring correctlySwitch Percent to Number in each rule
Text column can’t be formattedUse Field value with a DAX measure
Field value measure ignoredMake sure it returns valid text: “#RRGGBB” or a color name like “Red”
Totals look wrongSet Apply to to Values only
Colors change when filteringExpected with Gradient; use fixed numbers in Rules instead
Measure not showing in “Based on” listThe measure must return the right data type (numeric for rules, text for field value)

Frequently Asked Questions (FAQ)

How do I add conditional formatting in Power BI?

Select a table or matrix, open Format visual โ†’ Cell elements, pick the column under Apply settings to, turn on Background color, Font color, Data bars, or Icons, then click fx to set Gradient, Rules, or Field value.

Can I do conditional formatting based on another column in Power BI?

Yes. In the fx dialog, change What field should we base this on? to any other column or measure. For example, you can color Revenue by Profit Margin.

How do I use a DAX measure for conditional formatting in Power BI?

Create a measure that returns a hex code (like “#1E8449”) or a color name. In the fx dialog, choose Format style: Field value and select that measure.

Can I apply conditional formatting to an entire row in Power BI?

Not with a single setting. Create one color measure and apply it with Field value to every column. The whole row will then share the same color.

Why is conditional formatting not available on my bar chart?

The fx option is hidden when the chart uses a Legend or more than one measure. Remove the legend or extra measures to enable it.

Can I use conditional formatting on text values in Power BI?

Yes. Use Field value with a measure such as IF(SELECTEDVALUE(Table[Status])=”Late”,”Red”,”Green”).

What is the difference between Percent and Number in Power BI rules?

Number compares the actual value. Percent compares the value’s position between the column’s minimum and maximum. Most users want Number.

Does conditional formatting work in the Power BI service and mobile app?

Yes. Formatting created in Power BI Desktop carries over when you publish to the Power BI service and also shows in the mobile apps.

Can I add custom icons in Power BI?

The Rules style offers built-in icon sets. For fully custom images, return an image URL or SVG from a measure and set the column’s data category to Image URL.

How do I remove conditional formatting in Power BI?

Right-click the field in the field well โ†’ Remove conditional formatting, or turn off the toggle under Cell elements.

Conclusion

Conditional formatting turns static Power BI reports into reports that show where to look. To recap:

  • Background and font color highlight good and bad values.
  • Data bars compare magnitude inside a table.
  • Icons give a quick status at a glance.
  • Gradient, Rules, and Field value cover everything from heat maps to complex DAX logic.

Start with one rule on your most important KPI, check it with real users, then expand. Next, try these Power BI measure examples or browse all Power BI tutorials on EnjoySharePoint.

Leave a Comment