In order to do this, you must define the measure for each dimension value.
I've attached an example using the Superstore data set provided with Tableau. I've created a measure for each dimension value in the "Customer Segment" dimension. For example, consumer sales is calculated as:
IF attr([Customer Segment]) = 'Consumer' then sum([Sales]) end
Similarly, Corporate Sales is:
IF attr([Customer Segment]) = 'Corporate' then sum([Sales]) end
Then, you place each of those measures on the Label shelf. Then, click on the Label shelf to display the formatting option for the labels, and manually color each label the way you want:
The result is:
8.1 workbook example attached. I hope this helps! Note that I didn't bother matching the colors exactly in this example...
Color Labels to Match Lines ML.twbx 972.2 KB
Thank you Matthew. I was able to get this to work. I appreciate the quick response as well.
No problem! Glad to help
I know this was answered back in January, but I just wanna THANK YOU Matthew! So glad I found this! This also helps me "hide" labels for certain series, while having them show on others.
Best hack ever! Feel like it should be easier to do in Tableau, but whatevers
Thanks a million! (:
No problem! Thanks for taking the time to thank me. Even though I picked this up from someone else, it's nice to feel someone else's Tableau gratitude from time to time!
Take care and best of luck!