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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
viniciusabreu
Regular Visitor

How to create conditional formatting in "new measure"

Hi,
I created a new measure that results in a number value, I would like that if this value was greater than "0" this value would remain in green and if it was less than "0" it would remain in red. Is it possible to do that? Someone help me?

 

viniciusabreu_0-1690288914189.png

 

 

 

3 REPLIES 3
viniciusabreu
Regular Visitor

Hi,
when applying this formula, powerbi is returning the color code:

viniciusabreu_0-1690292546666.png

viniciusabreu_1-1690292566061.png

 

Anonymous
Not applicable

Hi @viniciusabreu ,

 

You need to apply it in the right places:
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Idrissshatila
Super User
Super User

Hello @viniciusabreu ,

create a new measure for the conditional formatting that says 

formatting =
SWITCH ( TRUE (), measure > 0, "#008000", "#FF0000" )

and then apply it on the visual viewing this measure

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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