Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
taylororiger
Helper II
Helper II

Background Color manually

I am trying to assign a backgroud color to certain rows in my table.  However, the background color relies on 2 different criteria instead of 1, so I don't think I am able to achieve this in the conditional formatting route.  Is there a way to manually select rows to have a background color?

1 ACCEPTED SOLUTION

Hey, man  @taylororiger 
I did test it again, I tried to recreate something that you have and used the exact same formula:

Measure = SWITCH(TRUE(),
ISBLANK(MAX('PE Relationship Detail'[Engagement Quality Reviewer Name]))&&MAX('PE Relationship Detail'[PE total fees])>500000,"yellow")

vojtechsima_0-1646773618211.png
Applied to all columns and it works, the only thing that can be wrong is that make sure your blanks are actually blank, notice that in Power Query, blanks are "null". This won't appear in the Visual layer, however, make sure you can see it like that in power query:

vojtechsima_1-1646773718812.png

vojtechsima_3-1646773750945.png

You can replace it like this:

vojtechsima_4-1646773782307.png

if you don't want to test and debug anything, you can add something like to your formula that checks either blank or empty string:

Measure = SWITCH(TRUE(),
(ISBLANK(MAX('PE Relationship Detail'[Engagement Quality Reviewer Name])) || MAX('PE Relationship Detail'[Engagement Quality Reviewer Name])="")&&MAX('PE Relationship Detail'[PE total fees])>500000,"yellow")

This should work even when you don't have your blank rows actually blank. 
So try this new formula first and lemme know.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

View solution in original post

25 REPLIES 25

Hey, man  @taylororiger 
I did test it again, I tried to recreate something that you have and used the exact same formula:

Measure = SWITCH(TRUE(),
ISBLANK(MAX('PE Relationship Detail'[Engagement Quality Reviewer Name]))&&MAX('PE Relationship Detail'[PE total fees])>500000,"yellow")

vojtechsima_0-1646773618211.png
Applied to all columns and it works, the only thing that can be wrong is that make sure your blanks are actually blank, notice that in Power Query, blanks are "null". This won't appear in the Visual layer, however, make sure you can see it like that in power query:

vojtechsima_1-1646773718812.png

vojtechsima_3-1646773750945.png

You can replace it like this:

vojtechsima_4-1646773782307.png

if you don't want to test and debug anything, you can add something like to your formula that checks either blank or empty string:

Measure = SWITCH(TRUE(),
(ISBLANK(MAX('PE Relationship Detail'[Engagement Quality Reviewer Name])) || MAX('PE Relationship Detail'[Engagement Quality Reviewer Name])="")&&MAX('PE Relationship Detail'[PE total fees])>500000,"yellow")

This should work even when you don't have your blank rows actually blank. 
So try this new formula first and lemme know.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

That was the issue!!! Thank you!

@taylororiger 
Oh boi,
I am glad it is finally working, if you could kudo my answer and accept it as the solution I would really appreciate that.
Thanks






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

Hi!  I am trying to d a similar measure, however, I am not able to apply the measure to conitional formatting?

taylororiger_0-1649168083356.png

 

Any thoughts?

Thank you!  I do know how to apply conditional formatting and I have it applied across all of the columns.  I think the issue is the measure isn't reading correctly, and I am not sure how to write that or adjust it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.