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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rainchong7401
Helper III
Helper III

How to add font color or background color

Hi Friends,
How to add font color or background color for every last year.
Kindly assist. 

I've provide my file in the link down below.
https://www.dropbox.com/s/5mzjdamxicrs4ks/TEST--v2.pbix?dl=0

1.png

1 ACCEPTED SOLUTION
SamInogic
Super User
Super User

Power BI allows Values to be formatted based on data, using Conditional formatting.

 

1Conditional Formatting.jpg

In your report, for Measure in the Values property set the Background Colour using Conditional Formatting as shown in the below screenshot.

2Conditional Formatting.jpg

Set the colour as per the condition required, on the Year column as shown in the below screenshot.

3Conditional Formatting.jpg

 

Thanks!

Inogic

Innovative Logic  

Web: www.inogic.com/services/

Blog: http://www.inogic.com/blog

twitter: @inogic

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

View solution in original post

9 REPLIES 9
SamInogic
Super User
Super User

Power BI allows Values to be formatted based on data, using Conditional formatting.

 

1Conditional Formatting.jpg

In your report, for Measure in the Values property set the Background Colour using Conditional Formatting as shown in the below screenshot.

2Conditional Formatting.jpg

Set the colour as per the condition required, on the Year column as shown in the below screenshot.

3Conditional Formatting.jpg

 

Thanks!

Inogic

Innovative Logic  

Web: www.inogic.com/services/

Blog: http://www.inogic.com/blog

twitter: @inogic

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Hi Sam,
You're very good. 
Your solution is straight forward and accurate result.

PBI_Helpline
Helper I
Helper I

Hi,
Based on your attached PBIX, where you have used only one measure but 2 column headers,  and below kind of formatting for 'HEADERS" are not available with specific column, because that will be enabled only if you have more than one measure.

PBI_Helpline_0-1669981737666.png
Above is possible with specific column only if you use more than one measures.
 Since your Meassure is giving values for 2 consecutive years based on selected year in the slicer, it has only one measure, but two fields in Column header well,
and in this case you can use below conditional formatting measure to format values section of your Matrix visual.  it means, Headers can not be formatted with different colors, in this case., if required you can select one single column header color.

PBI_Helpline_1-1669982075407.png

 


Thank You,
I post Interesting Power BI Solutions on below You-tube channel.
https://www.youtube.com/@PowerBIHelpline
Check this out.


 

Hi PBI,
What about I want font color to change instead of Background? 

Yes,
That can be applied on font color as well same way.

PBI_Helpline_0-1669999040512.png

 

Hi PBI,
Where do you put the format measure into and make it look colorful?
Kindly show me the location where do you put the "format" measure.
You may screenshot and show me step by step or,
If possible share your work via google drive or dropbox. 

1.png
This is mine looks ugly and it's not exactly like what you do.
2.png

If you click on the small dropdown arrow on your measure name in values section. like below, you will see conditional formatting option for all the available formattings. Font, background, icons..

PBI_Helpline_0-1670064592785.png

Click on Conditional Formatting > Font> in Format Type select "Field value> Apply to "values and Total" > and in measure section select the new Format measure, which you created for color formatting.


Thank You,
I post Interesting Power BI Solutions on below You-tube channel.
https://www.youtube.com/@PowerBIHelpline
Check this out.

amitchandak
Super User
Super User

@rainchong7401 , Create a measure and use in conditional formatting using field value option

 

bg color = If(Max(Table[Year]) = Maxx(allselected(Table), Table[Year]) -1, "Yellow", "White")

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,
What about I want font color to change instead of Background? 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors