Forum Discussion
How to replace script with set back ground color for sales vari % field ?
Hi All
I have below expression to give sales vari % :-
Hey admin11 ,
basically, it's not possible to convert the rule-based conditional formatting into a script.
What you can consider to create a measure that returns the name of a color llike "red" or "#ffffff" if a certain conditons are met, otherwise the measure will return other colors. You can achieve this by using the SWITCH statement.. Then you can use this measure and the value-based conditional formatting.
But, as the conditional formatting is tight to the visual you have to enable conditional formatting whenever you use your "Sales var ..." measure.
Hopefully, this will help to tackle your challenge.
Regards,
Tom
1 Reply
- TomMartens
Super User
Hey admin11 ,
basically, it's not possible to convert the rule-based conditional formatting into a script.
What you can consider to create a measure that returns the name of a color llike "red" or "#ffffff" if a certain conditons are met, otherwise the measure will return other colors. You can achieve this by using the SWITCH statement.. Then you can use this measure and the value-based conditional formatting.
But, as the conditional formatting is tight to the visual you have to enable conditional formatting whenever you use your "Sales var ..." measure.
Hopefully, this will help to tackle your challenge.
Regards,
Tom