Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Conditional formatting is one of the most powerful tools in Power BI for highlighting insights and trends. A pop of red or green instantly tells the story behind the numbers.
But every Power BI developer knows the pain: applying formatting visual by visual, and column by column, is incredibly repetitive, especially on complex financial dashboards.
In this blog, I will share practical DAX strategies you can use today to centralize your formatting logic, saving you hours of clicking. Then, I’ll open a discussion on a feature I believe we desperately need: Measure-Level Conditional Formatting Rules.
Part 1: The Current Challenge (The "12-Month Matrix" Problem)
To understand why this is painful, consider a standard Financial P&L Matrix. You have metrics like Total Profit displayed across 12 columns (January through December).
Looking at a plain table of numbers makes it hard to spot trends quickly.
Currently, to highlight negative values in red, you must manually open the formatting pane for January, set the rule, then repeat the exact same process for February, March, and so on. If you change your mind later (e.g., you want negative values to be Orange instead of Red), you have to edit it 12 separate times. This leads to maintenance nightmares and inconsistent reporting.
Part 2: The "Survival" Strategy (Centralized DAX Logic)
Until we get native page-level controls, the best strategy is to centralize your formatting logic using DAX.
Instead of using the standard "Rules" interface within the formatting pane (which locks logic into a single visual or column), we will use the "Field Value" option.
Step 1: Create a "Color Logic" Measure
First, create a dedicated measure that defines your color logic in one place. Using the SWITCH(TRUE()...) pattern allows you to define complex rules and return specific Hex codes.
Here is a measure designed for a general financial metric:
Formatting_Color =
SWITCH( TRUE(),
-- Red for negative values (Loss)
SUM(Financials[Amount]) < 0, "#FF0000",
-- Yellow for low positive values (Between 0 and 5k)
SUM(Financials[Amount]) >= 0 && SUM(Financials[Amount]) < 5000, "#FFFF00",
-- Teal/Dark Green for high values (Above 5k)
SUM(Financials[Amount]) >= 5000, "#057576",
-- Default white background for any other case
"#FFFFFF"
)
Step 2: Apply as "Field Value"
This is the magic step. Instead of defining rules, we tell Power BI to use the color codes generated by our measure.
The Result
Instantly, your entire matrix, across all 12 months, is formatted based on that single measure. If you ever need to change a color, you update the DAX measure once, and everything updates automatically.
Part 3: Leveling Up (Row & Column Specific Logic)
What if you don't want to color everything? The standard formatting tools apply rules to the "Values" generally, but DAX allows us to be surgical. We can target specific rows or specific columns.
Scenario A: Targeting a Specific Row (Row-Level) Let's say you only want to highlight the "Profit" row but leave the "Sales" row clean. We can modify our measure to check the context of the current row [Category].
Formatting_Profit_Row_Only =
VAR CurrentCategory = SELECTEDVALUE(Financials[Category])
VAR CurrentAmount = SUM(Financials[Amount])
RETURN
SWITCH( TRUE(),
-- Rule 1: If the row is 'Profit' and value is negative, apply RED
CurrentCategory = "Profit" && CurrentAmount < 0, "#FF0000",
-- Rule 2: If the row is 'Profit' and value is positive, apply GREEN
CurrentCategory = "Profit" && CurrentAmount >= 0, "#00FF00",
-- Default: Leave other rows (e.g., Sales) unformatted/white
BLANK()
)When you apply this measure using the same "Field Value" technique, you get a much cleaner, more professional result where only the key information is highlighted.
Scenario B: Targeting a Specific Column (Column-Level) Conversely, maybe you want to highlight a specific time period—for example, making the December column stand out in Gold to draw attention to year-end performance.
Formatting_Dec_Column_Only =
VAR CurrentMonth = SELECTEDVALUE(Financials[Month])
RETURN
IF(
-- Check if the current column is December
CurrentMonth = "Dec",
"#FFD700", -- Apply Gold color
BLANK() -- Keep other months unformatted
)By switching the "Field Value" to this new measure, you instantly highlight just that vertical column across all your metrics.
Part 4: The Dream Feature (True Page-Level Rules)
While the DAX method above is a powerful workaround, it still requires us to manually apply the "Field Value" setting to every single visual.
This brings me to my proposal for the Power BI team.
The Concept: Page-Level Conditional Formatting
Imagine if the Page Canvas itself had a conditional formatting menu. You wouldn't need to touch individual charts or matrices.
Instead, you would go to the Page Settings and define a global rule:
"For this Page: Anywhere [Total Profit] is used, apply this Red/Green logic."
How it would work:
The Connection:
This contrasts with the DAX method because it centralizes the application. You wouldn't need to open the "Cell Elements" menu for 10 different visuals. You set it at the Page level, and you are done.
Conclusion & Call to Action
Using DAX "Field Value" measures is currently our best defense against repetitive formatting work. It keeps your logic centralized and allows for advanced scenarios like row-level highlighting.
However, I believe native Page-Level Conditional Formatting (with options for row-level cascading) would be a game-changer for report developers.
Vote for the Idea, I have submitted this as a feature request in the Ideas forum. If you agree that this would make our lives easier, please vote here: Page-Level Conditional Formatting Rules in Power BI
What do you think? Do you use the DAX method, or do you have another trick for managing formatting at scale? Let's discuss in the comments below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.