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
siddrow
Helper III
Helper III

Card conditional formatting not working for <1 turn red

 Hi

 

I have a card that is linked to an MS List and the column is set to number type. I have tried putting a conditional formatting on the card number to say if the number is <1 then turn text green and if the number is >=1 then turn red. I have some zeros in my MS list and they are showing on the card as red. How do I get the conditional formatting to work?

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

Hi @siddrow ,

Do you mean the Card visual like below? But card visual can only display one number.

vkalyjmsft_0-1655886933523.png

I create a sample using a table visual, here're the steps:

1.Create a measure.

Measure = IF(MAX('Table'[Column])<1,"Green","Red")

2.In the visual formatting pane>Cell elements, turn on the Font color button.

vkalyjmsft_1-1655887336229.png

Select the Field value in the Format style and select the measure in the field pane.

vkalyjmsft_2-1655887553163.png

Get the result.

vkalyjmsft_3-1655887678234.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @siddrow ,

Do you mean the Card visual like below? But card visual can only display one number.

vkalyjmsft_0-1655886933523.png

I create a sample using a table visual, here're the steps:

1.Create a measure.

Measure = IF(MAX('Table'[Column])<1,"Green","Red")

2.In the visual formatting pane>Cell elements, turn on the Font color button.

vkalyjmsft_1-1655887336229.png

Select the Field value in the Format style and select the measure in the field pane.

vkalyjmsft_2-1655887553163.png

Get the result.

vkalyjmsft_3-1655887678234.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

amitchandak
Super User
Super User

@siddrow , You can use measure conditional formatting

Assume you have a measure number 

 

Switch(True() ,

[Number] < 1, "Green" , "Red"

)

 

PowerBI Abstract Thesis: 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/...

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Sorry not sure what you mean when you saw measure number. 

 

My cards are pulling the data from the queries, there are no measures attached to them at the moment. How would I add a measure to change the colour if <1 to green and =>1 to red but also show 0 instead of blank?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

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!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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