This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi All
Today i have try to modify the below table report , and when i put back the Variance % , the traffic light colour reset , and i need to set up again. Since i have many table , and i want to change the traffic light from Rule base to script base :-
if Variance >50% Yellor Color
if Variance >10% and <50% Green Color
if Variance <10% Red Color
Hope that some one can help me write the script.
My PBIX file :-
Solved! Go to Solution.
@Anonymous
Put the following formula in a measure and then add it in the conditional formatting (using field value).
Background Color 1 =
VAR _variance_per_country =
CALCULATE ( [Variance %], ALLEXCEPT ( 'order', 'order'[Customer Id] ) )
RETURN
SWITCH (
TRUE (),
_variance_per_country < 0.2, "#D64550",
_variance_per_country < 0.5, "#E8D166",
_variance_per_country <= 10, "#79FF00",
"#00000"
)
@Anonymous
Put the following formula in a measure and then add it in the conditional formatting (using field value).
Background Color 1 =
VAR _variance_per_country =
CALCULATE ( [Variance %], ALLEXCEPT ( 'order', 'order'[Customer Id] ) )
RETURN
SWITCH (
TRUE (),
_variance_per_country < 0.2, "#D64550",
_variance_per_country < 0.5, "#E8D166",
_variance_per_country <= 10, "#79FF00",
"#00000"
)
Hi Sir
Thank you so much , it work fine now .
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |