Forum Discussion
How to Assign Hex Code Based On Measure Value
- 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/
Hello VahidDM
Thank you for replying to another one of my posts. The measure you provided works fine but again still can't display visual after formating the colours.
It appears with the same error message - as soon as I colour format from the Data Label menu, the display card shows the error message along with "Function: SWITCH does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT fuction to convert one of the values."
However, [Total Sales Variance Percent] is formatted as a Percentage.
Any tips?
Anonymous
Is it possible to share a PBIX file [after removing sensetive data]?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/