Highlight Variance with different Border Color in Deneb

The objective is to compare the plan data with actual data and change the border color of the cell using Measures i.e. values less than zero as red border and others default black color, while retaining the fill color.



Highlighting Variances.pbix (4.2 MB)

Thanks

Hi @brooks65.

Your JSON code was very close. To get the border colour to render as you want, the key should be named “stroke” instead of “symbolStrokeColorColor” and the code block should be located in the “mark” block instead of the “encoding” block:

Here’s one option for the “mark” code block:

        "mark": {
          "type": "rect",
          "stroke": {
            "expr": "datum['13_ FinishDateVariance'] >= 0 ? 'black' : 'red'"
          }
        },

As well, your measure for [13. FinishDateVariance] didn’t give values that allowed me to test the code properly, so I adjusted it; you’ll need to check your data and/or formulae. Here’s the adjusted code:

13. FinishDateVariance = 
// test
IF( MAX( ScheduleData[HC-UnitID] ) = "VM-075", -7, 7 )
// original
//DATEDIFF('Measures Table'[04. ActFinish],'Measures Table'[02. PlanFinish],DAY)

Hope this helps.
Greg
eDNA Forum - Deneb Highlighting Variances with Stroke Colour.pbix (4.2 MB)

Hi Greg,
Thanks once again for correcting the Deneb code and highlighting me the problem with the Measure. The challenge with the visual is that I want the red-lining on the Act/Fcst side of the table for elements that are not following the plan.

I agree the Measure is not correctly written to filter the Plan items from the table and then check if those items are completed or not. Since the date slicer applies to both the Plan and Act/Fcst dates alike, some of the Act/Fcst data is not filtered as they are beyond the date range of the slicer and therefore the red-lining of the border on the Act/Fcst table not timely displayed.

I will have to re-write the Measure such as that the date range from the slicer selection filters the unique list of activity id that should be in play during the given period of time and then review the act/fcst table range to indeed check if those items have commenced, idenitfy the variance using the forecast dates to redline the act/fcst side of the table.

And have the variances recorded only to Act/Fcst table range and register a zero for the plan table range. Hopefully with that i should achieve my objective. I will try to figure it out.

Thanks for your help.