There is an older post that was deleted from the forums that I will bring back here:
This was originally supplied by a user in the forums Cathrine Rivier
Unfortunately I don't believe that's possible as a feature in Tableau as is. (Of course, if I'm wrong on that, hopefully someone will correct me!) But, doing some tests, I found if you select the lines using the color legend, rather than the data line itself, it should select both the trend line and the data line. I wanted to point this out just in case this is an acceptable solution.
But, there is a way to do exactly what you describe - but keep in mind it won't update when your data does. Basically, you'll make fake trend lines based on the same model. Here are the steps:
- Copy your trend line model equation (under Describe Trend Line)
- Create a calculated field that sets this for each category using a CASE statement. For example: CASE [Category] WHEN "Coffee" THEN .0646*[Sales]+1234... ELSE 0 END
- Pull this new calculated field as the secondary axis (average, not sum), remove all existing trend lines. (This should look exactly the same as your original view.)
- To set highlighting the way you want, create a new Action - Highlight. Run action on Select, with Target Highlighting being just the field that currently creates your color.
Since I'm not sure whether this is what you're looking for, I'm not posting a sample workbook - but let me know if it is and I can do so.
Hope this helps!
Message was edited by: Catherine Rivier Just kidding, adding a sample workbook since I already had it!
TrendLineHighlighting.twbx 1.2 MB
Thanks Patrick Van Der Hyde,
Unfortunately since I don't know the trend line equations (since they will be changed at whim), I can't create calculated fields using them. Need a calculated field that will derive the equation on its own