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
Syndicate_Admin
Administrator
Administrator

Color Text Data Within a Table

Good morning

I would like to know how I can assign a specific color to each type of data that is included within a column (TERM) in a data table (Figure 1). Specifically I want to assign background two colors, green for OK and red for NO OK. You can see how the PLAZO table is constructed and categorized in Figure 2 and 3. Thank you very much in advance for any help or advice you can give me about it.

A greeting

Joseph I. Del Pino B.

6.JPG

Figure 1.

7.JPG

Figure 2.

8.JPGFigure 3.

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

I agree with timg. Conditional formatting can solve your problem. You can create a Measure as the following and then format your data column with it.

 

Color_TEXT =

SWITCH ( SELECTEDVALUE ( 'Table'[PLAZO] ), "OK", "Green", "NO OK", "RED" )

 

The result looks like this:

v-cazheng-msft_0-1613018780964.png

 

v-cazheng-msft_1-1613018780965.png

 

Best Regards,

Caiyun Zheng

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

I agree with timg. Conditional formatting can solve your problem. You can create a Measure as the following and then format your data column with it.

 

Color_TEXT =

SWITCH ( SELECTEDVALUE ( 'Table'[PLAZO] ), "OK", "Green", "NO OK", "RED" )

 

The result looks like this:

v-cazheng-msft_0-1613018780964.png

 

v-cazheng-msft_1-1613018780965.png

 

Best Regards,

Caiyun Zheng

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

timg
Solution Sage
Solution Sage

Hi,

You can apply these settings through conditional formatting. You can find this in the formatting tab when you have selected the table. 

1.PNG

Best regards,

Tim





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.