Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey everyone,
Making a simple bar chart here and trying to get my colors by expression to work. They are still all the same color. Here is my example data.
I am trying to get the table to show the percentage of employees every day based on Area_Emp.
So first I need to get Actual_Emp/FTE_Emp to get percentage, then make that either blue if below .95% or red if over .95%.
Here is the expression I am using.
Created a variable vAttend =Sum({$<Date_Emp={"$(=Date(Today()-3))"}>} (Actual_Emp / FTE_Emp))
Color expression in bar graph
if (sum(vAttend) < 0.95, '#f93f17', '#f93f17')
Currently they are all red.
Could you use a pivot table?
In a pivot table is easy to do this, just in "Background Color" in expressions or dimensions you can define your colors and rules
This expression is showing 0 result....
Sum({$<Date_Emp={"$(=Date(Today()-2))"}>} (Actual_Emp / FTE_Emp))
Also, you have this expression for the bars
=Sum({$<Date_Emp={"$(=FirstWorkDate(Today()-1,1,$(vHolidays)))"}>} (Actual_Emp / FTE_Emp))
and you want to use this for color?
Sum({$<Date_Emp={"$(=Date(Today()-2))"}>} (Actual_Emp / FTE_Emp))
As a side note, you CAN use hex colors like this:
num#('FFF93F17,'(HEX)')
The FF in the beginning replaces the # symbol.
It works for me just be putting your whole expression in there instead of your variable.
if(Sum({$<Date_Emp={"$(=FirstWorkDate(Today()-1,1,$(vHolidays)))"}>} (Actual_Emp / FTE_Emp)) < 0.95, red(), blue())
Does that work for you?
Actually it works for me using your variable if I copy and paste your measure expression into it.
make vAttend
Sum({$<Date_Emp={"$(=FirstWorkDate(Today()-1,1,$(vHolidays)))"}>} (Actual_Emp / FTE_Emp))