Hello,
Context:
In my organization, my role is cardbuilder. I have built a pivot table and ran into some issues with conditional formatting.
In my table, I have Daily Budget and Net Cost as two columns broken out by day. Ideally, I wanted the Net Cost column to turn RED (could be font or background - just something to flag it) if Net Cost > Daily Budget for that day. Given my data set has many different "advertising campaigns" that have different daily budgets, I cannot assign a specific dollar amount in the color rules. In an ideal world, I wish I could just tell it to turn red if Net Cost > Daily Budget column in the setup. From what I read, this is just a current "limitation" on how conditional formatting works at the moment.
As a "workaround", I created a new column called Overage. It basically shows the value if net cost exceeds daily budget for that day. (see screenshot). I did research and used a beast mode someone posted here that utilizes HTML as a workaround to spit out values in designated colors in my Overage Beast mode. This is the beast mode I used:
CASE WHEN (sum(`Net Cost`) - sum(`Daily Budget`)) > 0
THEN
CONCAT('<div style="background-color:#FF0000; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#FF0000">', sum(`Net Cost`)
-
sum(`Daily Budget`) , '</a></div>')
END
for some reason I keep encountering these issues:
- No matter what color code I use in the beast mode, the result always ends up the color in my screenshot (bluish)
- I tried adding in some <font> html codes, but no go
- I set the data format for the beast mode as currency ($) with 2 decimals but it doesn't follow this.
- is this because the beast mode shows up as "text string" vs "numeric"? How would I change that?
Any guidance would be helpful and appreciated!