Last tested: Sep 20, 2019
Some users want reference lines in their visualization that use metrics that are not in our standard drop-down options. They could always use a custom value, but that value is static, so if it is based on a calculation of the data, it doesn't quite suit their needs. This help center article explains how to create dynamic reference lines via table calculations, but if value labels are included, this can look a little messy. This post is how to address the "value label" problem.
This is an imperfect solution being that I have not yet figured out how to hide the null value on bar/column visualizations. This works best with charts where the reference value will be off the main visualization. Then you can use a dark color for the data and the reference value to mask the null value.
Less ideal use case:
Better use case:
After creating the table calculation for the dynamic reference line:
if(row() = count(${dimension}), ${reference_line_calculation}, null)
for the last rowif(row() = 1, ${reference_line_calculation}, null)
for the first rowThis content is subject to limited support.