Annotations vs Labels
Annotations in Tableau can be applied against a particular mark, a specific point, or an area on the canvas of your chart. Tableau’s own help documentation describes in detail what annotations are and how to use them, so I’m not going to go into detail on that in this post.
The primary difference between an annotation and a label is how they are displayed.
In the image above, the annotation is against the December 2020 mark, and is enclosed within a white box with rounded edges and a border. An arrow points to the mark being annotated.
By contrast the label just shows text, and while this text can be formatted (colour, font, size, style etc changed), there is no ability to change the overall ‘look’ of the label.
Typical Annotation Behaviour
However, unlike labels, when applying annotations against a mark, they don’t display when another mark is selected.
For example, in the image below, the mark for the customer, Dean percer, has been highlighted (in orange), and that mark has been annotated. The customer to highlight is based on the value in the pSelectedCustomer parameter. When that is changed to Ross Baird, the mark related to Ross is now highlighted in orange, but no annotations display at all; the annotation relating to Dean has disappeared, but no annotation is displayed for Ross. Changing the parameter back to Dean, and the annotation reappears.
This behaviour may be desirable. Perhaps there is something specific about the mark relating to Dean that does need to be described differently or explicitly called out via an annotation, that is not necessary for any other marks.
But what if you do want the annotation to continue to display? Well you can achieve this using a reference to the parameter instead.
Displaying the annotation when the mark changes
Using the example above, on the marks card that represents the highlighted mark (in this instance the orange circle), replace the Customer Name field on the Detail shelf, with the pSelectedCustomer parameter, and ensure the annotation dialog references the <Parameters.pSelectedCustomer> variable instead.
Now when the parameter is changed from Dean percer to Ross Baird and to any other Customer Name, the annotation is retained.
A workbook to accompany this blog post containing some of the examples discussed, can be accessed from here.