Graph with reference line and conditional formatting of bars

Hi,

I’m looking to create a bar chart with a reference line, with a signal colour (conditional formatting) for the bars when the target is not met.

First, the reference line. Every period, targets are adjusted. I’d like the reference line to show this adjustment. However I can’t seem to understand how to use the “Aggregated as” and “Calculate” to achieve this result. I’m only able to select a single value and it shows a straight line (which it shouldn’t) whatever I choose.
I prefer to use the reference line instead of the line from the combo chart since the customer demands the reference line to be dashed and I have not been able to create a dashed line in the combo chart.

Second, the conditional formatting. The client demands the colours of bars where the target has not been met to change colour. Unfortunately conditional formatting is not possible.
I have tried to create a calculated field which changes from 0 to 1 when the actual is smaller than target. However, when adding it to the group/colour field I now recieve the following message: “Custom aggregation field is not allowed as a dimension”.

How can I achieve the result demanded by the client?

Please refer below link for the conditional formatting of Bars.
https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Visual-Bar-Conditional-Formatting

As far as the reference line is concerned, line from combo chart will be the option if the target changes for each period. I can add a feature request to have dashed line in combo charts.

Hi, @LinkeLoutje. Did Vetri’s solution work for you? I am marking her reply as, “Solution,” but let us know if this is not resolved. Thanks!

Hi @n_vetri,

That feature request would be great!

Regarding your suggestion, I have tried to implement something similar as the example, however this results in the mentioned error message: “Custom aggregation field is not allowed as a dimension”.

Maybe you can help a little when I explain what I’ve tried. The following calculated fields are created:
KPI1 Bar Colour = ifelse({KPI}<MAX({Target}), ‘coloured’, ‘neutral’)
{KPI} = SUM({numerator_field})/SUM({denominator_field})

In the visual I use the date on the x axis, and {KPI} for the bars.

Why is it still throwing the error?

Thanks very much for your help