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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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