Deneb - color conditional formatting issue

Hi everyone,
I have a combined line chart ( current year sales vs. last year sales ), I’m trying to apply some conditional formatting for the color of the current sales line but it doesn’t work properly.
Here is my in-progress pbix file:
Deneb Color Conditional Formatting.pbix (1.5 MB)

Hi @Daniel_Derek

Your condition colour code looks just fine, but the “_variance_amount” transform is not calculating correctly as the field name doesn’t match the dataset, hence the conditional colour is not being applied.

The transform block should read:

  "transform": [
    {
      "calculate": "datum['total sales'] - datum['Sales (PY)']",
      "as": "_variance_amount"
    },
    {
      "calculate": "datum['_variance_amount'] / datum['Sales (PY)']/100",
      "as": "_variance_percent"
    }
  ]

Once named correctly, the line shows coloured.

Hope it helps.
Greg
eDNA Forum - Deneb Line Colour.pbix (1.5 MB)

1 Like

Thank you so much @Greg
Daniel