Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have a bar chart that displays the average courses ([Nome Evento]) an employee ([Nome do servidor]) has taken in a given period of time.
I want to color the dots based on whether the average of the selection is greater than the total average or not.
I tried this as an expression in the Colors and Legend tab:
if((Count({$} distinct [Nome Evento]) /GetSelectedCount([Nome do servidor])) > (Count({1} distinct [Nome Evento]) / Count({1} [Nome do servidor])), ARGB(255,0,101,128), ARGB(255,135,32,93))
But it doesn't work. All the dots are always colored by a single color, as seen bellow:
How can I make it look like this:
But with the red color being only the values in which the average of selection is lower than the total average?
Hi @lailarhc ,
Please find below expression
if((Count({$} distinct Curso) /GetSelectedCount([Nome do Servidor]))
>
(Count( total distinct Curso) / Count( total [Nome do Servidor])), ARGB(255,0,101,128), ARGB(255,135,32,93))
Note : At least more than 1 value to be selected for [Nome do Servidor] field.
Hi @lailarhc,
It's supposed to work. Can you please share sample data??
try
if((Count({$} distinct [Nome Evento]) /GetSelectedCount([Nome do servidor]))
>
(Count( total distinct [Nome Evento]) / Count( total [Nome do servidor])), ARGB(255,0,101,128), ARGB(255,135,32,93))
Hello. I created a table with all the columns I'm using in my project, without any filters applies, and downloaded it as an excel file. Is that what you meant?
The file is attached.
Hi @lailarhc ,
I hope you are looking for the same as below.
Hello @abhijitnalekar , can you please post the expression you used to achieve this result? Thank you
Hi @lailarhc ,
Please find below expression
if((Count({$} distinct Curso) /GetSelectedCount([Nome do Servidor]))
>
(Count( total distinct Curso) / Count( total [Nome do Servidor])), ARGB(255,0,101,128), ARGB(255,135,32,93))
Note : At least more than 1 value to be selected for [Nome do Servidor] field.