Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want the bars (4 years - 4 bars) in different colors and the line in completely different color in the combo chart.
Years in x axis and sales and % are in y axis. I tried the below code. It doesn't work. Can any one please correct the below code or give the alternate code for me?
if(Year=2015,(Sum([Sales]),rgb(166,166,166)), if(Year=2016,(Sum([Sales]),rgb(13,13,13)), if(Year=2017,(Sum([Sales]),rgb(255,0,0)),if(Year=2018,(Sum([Sales]), rgb(81,56,136)), Sum([Sales]),rgb(51,213,167)))))
if(Year=2015,rgb(166,166,166)), if(Year=2016,rgb(13,13,13)), if(Year=2017,rgb(255,0,0)),if(Year=2018,rgb(81,56,136)), rgb(51,213,167)))))
or
if(Year=2015 and Sum([Sales])>0,rgb(166,166,166), if(Year=2016 and Sum([Sales])>0,rgb(13,13,13), if(Year=2017and Sum([Sales])>0,rgb(255,0,0),if(Year=2018,(Sum([Sales]), rgb(81,56,136)), Sum([Sales]),rgb(51,213,167)))))
try to change ur expression
if(Year=2015 and Sum([Sales])>0,rgb(166,166,166),if(Year=2016 and Sum([Sales])>0,rgb(13,13,13)))
Thanks for your response Channa. Since I am using this code as the measure expression (need to mention the measure) I can not use if(Year=2015,rgb(166,166,166)), if(Year=2016,rgb(13,13,13)), if(Year=2017,rgb(255,0,0)),if(Year=2018,rgb(81,56,136)), rgb(51,213,167))))). It works good in the color section as a condition under by expression. But the line color also gets changed according to the year. I need one solid color for the line regardless of the year.
if(Year=2015 and Sum([Sales])>0,rgb(166,166,166),if(Year=2016 and Sum([Sales])>0,rgb(13,13,13))) seems a very good logic.
But it is not working for me.
in that case you have to use extinction from VIZLIB
it has option to have conditional color by each measure
Thank you Channa. I will try Vizlib extension...