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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kdesai
Frequent Visitor

Conditional coloring using card

I want to color a card conditionally based on a measure which is a percentage.

 

I have 2 percentage values for two sets of population say "High Cost" and "Regular"

 

I want to show the High Cost Card value in Red if its percentage exceeds the Regular percentage else in Yellow.

 

I am unable to do this with "States Card"- Not sure if I am doing Anything wrong.

 

Let me know if there is any other better way to do this.

Find below screen shots-

 

d1.PNGd2.PNGd3.PNG

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @kdesai, this is the link to the OKViz documentation: https://okviz.com/blog/states-in-custom-visuals/

 

I ran into the same issue and apparently, you need to place Language % HCP on "States Measure" and Language % Regular on "States" again. That will change the States panel under Formatting so you don't need to apply static values.

 

Also to change the background, you should change "Affect" to "Background" instead of "Data label". Mine is not working as this visual seems a bit fiddly, but if I find out the solution will let you know. Hope this helps.

v-yuta-msft
Community Support
Community Support

Hi kdesai,

 

Please refer to conditional formatting: https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors