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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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