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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
liamcol
Helper I
Helper I

Conditional formatting, 3 text options

Is there any way to set conditional formatting rules for a whole table based on text fields?

 

I have looked and can only create conditional formatting rules that are based off numbers. This is a snippet of the table. I would need yes values to be highlighted green, in transit light green, and no in Red. 


Would i need to create a number column for each? If so, how would i do that? 

 

Thanks! 

liamcol_0-1630910868767.png

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@liamcol 

Create the following measure, choose conditional formatting, Background , Select Field Value and choose this meaure:

CF =
VAR __V =
    MAX ( table[hardware assigned] )
RETURN
    SWITCH ( TRUE (), __V IN { "Yes", "In Transit" }, "Green", __V = "No", "Red" )

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @liamcol ,

Try like below:

step1,create a new measure:

Hardware =
IF (
    MAX ( 'Table'[Hardware Assigned] ) = "Yes",
    "#1E8449",
    IF ( MAX ( 'Table'[Hardware Assigned] ) = "In Transit", "#82E0AA", "#C70039" )
)

Step2, Click the visual column,conditional formatting-Background color:

vluwangmsft_0-1631085547256.png

Step 3, configure like below:

vluwangmsft_1-1631085614971.png

Final get:

vluwangmsft_2-1631085627848.png

About color code ,refer this link :https://www.computerhope.com/htmcolor.htm 

To learn more details ,refer: 

Conditional Formatting with a Text Field in Power BI

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!


Best Regards

Lucien

Fowmy
Super User
Super User

@liamcol 

Create the following measure, choose conditional formatting, Background , Select Field Value and choose this meaure:

CF =
VAR __V =
    MAX ( table[hardware assigned] )
RETURN
    SWITCH ( TRUE (), __V IN { "Yes", "In Transit" }, "Green", __V = "No", "Red" )

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks! It worked for me 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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