Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to implement specific colors to a Bar chart which is binned using a dual expression as a dimension. The expression to create the dimension is listed below and I'm using an measure to count the number of records. I would like to apply a different RGB color (Green / Yellow / Red) to each bin in the below chart, but nothing is working to add a color as an expression.
If(Ratio<=.2, Dual('0-20%',2),
If(Ratio<=.3, Dual('20-30%',4),
If(Ratio<=.4, Dual('30-40%',6),
If(Ratio<=.5, Dual('40-50%',8),
If(Ratio<=.6, Dual('50-60%',10),
If(Ratio<=.7, Dual('60-70%',30),
IF(Ratio <= .8, Dual('70-80%',40),
Dual('80%+',50))))))))
Try this
If(Max(Ratio)<=.2, LightMagenta(),
If(Max(Ratio)<=.3, Blue(),
If(Max(Ratio)<=.4, Green(),
If(Max(Ratio)<=.5, Red(),
If(Max(Ratio)<=.6, LightGray(),
If(Max(Ratio)<=.7, Brown(),
IF(Max(Ratio) <= .8, Yellow(),
LightCyan())))))))
Something like this in the background color for the expression isn't working?
If(Ratio<=.2, LightRed(),
If(Ratio<=.3, Blue(),
If(Ratio<=.4, Green(),
If(Ratio<=.5, Color4,
If(Ratio<=.6, Color5,
If(Ratio<=.7, Color6,
IF(Ratio <= .8, Color7,
Color8)))))))
Yeah that was my exact thought, but whenever I apply this approach to the color expression every bar is grey like the example screenshot. Perhaps I need to bin the data differently and not use the dual method as the dimension? I'm not sure how else to custom bin the data in the bar chart.
Try this
If(Max(Ratio)<=.2, LightMagenta(),
If(Max(Ratio)<=.3, Blue(),
If(Max(Ratio)<=.4, Green(),
If(Max(Ratio)<=.5, Red(),
If(Max(Ratio)<=.6, LightGray(),
If(Max(Ratio)<=.7, Brown(),
IF(Max(Ratio) <= .8, Yellow(),
LightCyan())))))))
Can you share sample application, Seems you are taking Dimension as Color, May be try the same in Expression BG Color
Yep - adding the Max function worked. Thanks for the tip.
how can it work on max function, tell me in this situation