Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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])
EX:
IF(SELECTEDVALUE('Variance'[Variance]) = "%", IF([% Gth] = "*", "#000000", IF([% Gth] < .01, "#FF0000", "#00CC66")),BLANK())
Solved! Go to Solution.
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,
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,
@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...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
74 | |
68 | |
51 | |
30 |
User | Count |
---|---|
115 | |
109 | |
71 | |
65 | |
39 |