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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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/...

 

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors