Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I have a card visualisation which shows a number (I checked that this is a number because I can perform different calculations with the result. My task is to color number inside card base on conditions.
I have a mesure which helps me to set a color:
Absolute_difference_CY_and_PY_color =
IF(
[CY_current_month_total_num_patient] - [PY_current_month_total_num_patient] < 0,
"#EE2000", // Red for negative
IF(
[CY_current_month_total_num_patient] - [PY_current_month_total_num_patient] = 0,
"#000000", // Black for zero
"#04FF00" // Green for positive
)
) After I set a conditional formatting: Callout values -> Series All (I don't know what this means) -> Color -> Format syle: Field Value -> What field should we base on: Absolute_difference_CY_and_PY_color
This is doesn't work. Where is my mistake, please?
Solved! Go to Solution.
Hi, @alks_skla_f
I've simply modelled some data that I hope will solve your problem.
Measure Color = SWITCH(TRUE(),
[Current]-[Previous]<0,"#EE2000",
[Current]-[Previous]=0,"#000000",
"#04FF00")
Displayed in the card.
Result:
Check to see if you've added conditional formatting in the right place.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @alks_skla_f
I've simply modelled some data that I hope will solve your problem.
Measure Color = SWITCH(TRUE(),
[Current]-[Previous]<0,"#EE2000",
[Current]-[Previous]=0,"#000000",
"#04FF00")
Displayed in the card.
Result:
Check to see if you've added conditional formatting in the right place.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @alks_skla_f ,
Here are couple of screenshots, you should be good with the measure,
But as @Fowmy mentioned, Check whether your CY and PY values are right(Numeric Formart).
If they return integer or numeric format, you should be good to achive this color formatting.
Thanks,
Punith
@alks_skla_f
You have taken the right approach, I believe the issue is in the measures involved in CF.
1. Add the measure "Absolute_difference_CY_and_PY_color" to card visual and check what results you get, it should show the color codes based on the conditions, check the filters applied.
2. Also, check individual measures to know if they return the expected results.
[CY_current_month_total_num_patient] and [PY_current_month_total_num_patient]
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |