Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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