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
Snagalapur
Helper IV
Helper IV

Cards - Conditional format

Hi All,

How to conditional format cards using formula. i would like to colour red or Green based on values using formula. Kindly suggest.

% Bud = SUM( [actual_op])/SUM( [budget])

Snagalapur_0-1739878838103.png

 

EX:

IF(SELECTEDVALUE('Variance'[Variance]) = "%", IF([% Gth] = "*", "#000000", IF([% Gth] < .01, "#FF0000", "#00CC66")),BLANK()) 

 

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Snagalapur ,

 

To conditionally format a Card Visual in Power BI based on the % Bud measure, you need to create a DAX measure that defines the color logic and then apply it to the card’s formatting options.

First, define a new measure that evaluates the value of % Bud and assigns a color based on the threshold. If the value is less than 100%, it should be red (#FF0000), and if it is 100% or more, it should be green (#00CC66).

% Bud Color =
VAR Value = SUM([actual_op]) / SUM([budget])
RETURN
    IF(Value < 1, "#FF0000", "#00CC66")

Once the measure is created, go to the Card Visual displaying the % Bud value. In the Visualizations pane, navigate to the Format Your Visual section (paint roller icon), expand Callout Value, and click on the fx (Function) Icon next to the Color option. In the pop-up window, select Format by → Field Value and choose the newly created % Bud Color measure. Click OK to apply the changes.

This setup ensures that the card dynamically changes color, turning green when the budget percentage is ≥ 100% and red when it is below 100%.

 

Best regards,

View solution in original post

2 REPLIES 2
DataNinja777
Super User
Super User

Hi @Snagalapur ,

 

To conditionally format a Card Visual in Power BI based on the % Bud measure, you need to create a DAX measure that defines the color logic and then apply it to the card’s formatting options.

First, define a new measure that evaluates the value of % Bud and assigns a color based on the threshold. If the value is less than 100%, it should be red (#FF0000), and if it is 100% or more, it should be green (#00CC66).

% Bud Color =
VAR Value = SUM([actual_op]) / SUM([budget])
RETURN
    IF(Value < 1, "#FF0000", "#00CC66")

Once the measure is created, go to the Card Visual displaying the % Bud value. In the Visualizations pane, navigate to the Format Your Visual section (paint roller icon), expand Callout Value, and click on the fx (Function) Icon next to the Color option. In the pop-up window, select Format by → Field Value and choose the newly created % Bud Color measure. Click OK to apply the changes.

This setup ensures that the card dynamically changes color, turning green when the budget percentage is ≥ 100% and red when it is below 100%.

 

Best regards,

amitchandak
Super User
Super User

@Snagalapur , Based on what I got, You can create a measure like below and use conditional formatting using fx option and field values

 

COlor = if([% Bud] <.9, "Red", "Green")

 

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/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.