Forum Discussion
Anonymous
4 years agoNot applicable
How to Assign Hex Code Based On Measure Value
Hello everyone, I have a measure that I want to assign colours based on whether it's positive or negative. Colour1 = VAR MySelection = SELECTEDMEASURE() RETURN SWITCH( [Total Sales Varianc...
- 4 years ago
Hi Anonymous
Try this:
Colour1 = SWITCH ( TRUE (), [Total Sales Variance Percent] > 0, 1, [Total Sales Variance Percent] < 0, 2, BLANK () )Then define color1=1-> #41AC4C and if color1=2 -> #E42925
or use this:
Colour1 = SWITCH ( TRUE (), [Total Sales Variance Percent] > 0, #41AC4C, [Total Sales Variance Percent] < 0, #E42925, BLANK () )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
smpa01
4 years agoCommunity Champion
Anonymous
Once you write a measure like this
Measure 2 = SWITCH(TRUE(),[Measure]=1,1,2)
you need to navigate here and mention the values
which will generate this