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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
BeingAslam
Frequent Visitor

Card Value Negative red and Positive Green

Dear friends, I want my value to turn red when it is negative and green when it is positive.

This value is current year - (minus) last year

 

BeingAslam_0-1701332441227.png

 

Regards

10 REPLIES 10
Ritaf1983
Super User
Super User

Hi @BeingAslam 
You can create a measure like :

flag = if (sum('Table'[value])> 0,1,0)
And then modify the conditional formatting of the card value according to this measure :
Ritaf1983_0-1701333481531.png

 

Result

Ritaf1983_1-1701333505598.pngRitaf1983_2-1701333533706.png

PBIX is attached

Please note :
it is not recommended to use traffic light colors to emphasize messages, as people with color blindness do not see a difference between red and green. Therefore, it is recommended to use combinations of blue and red, and not green and red.
For more information about color issues please refer :
 
 

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi Ritaf this is solution not work properly, suggest another.

This solution should work perfectly according to the description,
If it is not, please share the dummy file to check why.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I have a measure which is adding current year sales minus last year, but when I apply filter then this condition is not working properly.

Ahmedx
Super User
Super User

do it like in the screenshot

Screenshot_3.png

Hi Ahmed this is solution not work properly, suggest another.

explain why it doesn't work

I have a measure which is adding current year sales minus last year, but when I apply filter then this condition is not working properly.

screenshot to the studio so we can understand you

and when you change the filter, does the measure give the correct result?

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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