Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculated Background Color in Dimension

I have a calculated dimension in a pivot table and I am trying to highlight the 'actual' column if it's greater than the 'projected' column.

The actual calculation is working fine, but I can't get the background color to work properly.  I have a feeling I made a stupid mistake but I can't get this last detail working.

Projected dimension is a static value related to the primary dimension Location.

Actual: =aggr(sum(ActualDays),Location)

Background Color: =if((aggr(sum(ActualDays),Location))>ProjectedDays,LightRed())

Desired Result (background instead of text color):

LocationsProjectedActualMonth8/1/20177/1/2017
Location A315410131
Location B8296197208
Location C3121835131

Current State:

Capture.PNG

Thank you

8 Replies
sergio0592
Specialist III
Specialist III

For me, you don't have to use aggr() in your pivot chart. sum(Actual) and sum(Projected) are enough. And for the text color =if(sum(Actual)>sum(Projected), red())

Anonymous
Not applicable
Author

Each location has a static projected days number that is totally separate from other location projections.  The actual days also link directly to each location which is why I tried the aggr direction.  It just seems strange that the aggr Actual column calculation does not work when using it in an if statement with the background color, but it does work in a calculated dimension.

Thank you

vishsaggi
Champion III
Champion III

did you try like this?

=if( Sum(aggr(sum(ActualDays),Location)) > ProjectedDays , LightRed() )

Not applicable
Author

Hi Philip,

Can u share sample script?

Thank you

Not applicable
Author

Philip.JPGDimension->Used Dimension->Select Actual->Click on + Symbol->Background Color-> Write your Expression

Not applicable
Author

Demo1.PNG

Not applicable
Author

solution1.PNG

oseimuduame
Creator II
Creator II

This was very helpful for me.

Thank You for Sharing