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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
engingee
Helper I
Helper I

condition font colour personalised rule apply

Hi everyone,

 

I have a table below in Power BI, and I would like to add a font colour (red) according to my conditional formatting rule.

 

The table is something like below, and the condition I would like to apply is: when column B less than 4, OR column C less than 50, OR column D less than 1, the all table's font colout becomes red (except title row)

ABCDE
XX1501.2XX
XX3.845.410.73XX
XX342.710.28XX
XX366.490.66XX
XX345.50.38XX
XX369.950.28XX
XX245.40.27XX
XX843.170.45XX
XX538.130.53XX
XX4.443.060.42XX
XX542.780.33XX

Is this something  feasible in PowerBI please? Many thanks!!!!!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

yes, you need to write a calculated column or measure (depending on if the result can be influenced by user interaction)  across the entire visual (ALLSELECTED) .  You can use MINX for your test.

 

Your sample date is insufficient - it always satisfies the red color condition.  I changed the first row's B value to 4 to show the difference.

 

See attached.

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

yes, you need to write a calculated column or measure (depending on if the result can be influenced by user interaction)  across the entire visual (ALLSELECTED) .  You can use MINX for your test.

 

Your sample date is insufficient - it always satisfies the red color condition.  I changed the first row's B value to 4 to show the difference.

 

See attached.

Hi @lbendlin , thanks for your explanation. I tried the attachement, but the yellow line I marked should be black colour, rather than red according to the rules, isn't it? Thanks!

 

Screenshot 2022-03-02 124554.jpg

 

Not according to the rules you stated.

The table is something like below, and the condition I would like to apply is: when column B less than 4, OR column C less than 50, OR column D less than 1, the all table's font colout becomes red (except title row)

You were talking about the entire table. Looks like what you actually meant was that you want to apply the rule per row?

 

 

Hi @lbendlin yes, you are correct, I did not explain it clearly, actually it should be the entire rows becomes red, sorry about the confusion 

Change the measure definition:

 

FontColor = SWITCH(TRUE(),MIN('Table'[B])<4,"Red",MIN('Table'[C])<50,"Red",MIN('Table'[D])<1,"Red","Black")

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.