Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |