You're not going to find this pleasant. Reference lines are designed to give details about the measure. Not about where it came from. The tooltip does this. To make sure we are referring to the correct thing the tooltip is what you see when you hover/click on a mark (bar in your bar chart). The reference line will report the aggregation and the value. (The average is x).
You are already showing the category via having it as a header. And you have hidden the year. If you insist on showing (on a reference line) year and category. You will need to make a dual axis graph. The second measure in the dual axis graph would be the following formula.
WINDOW_AVG(SUM([Sales])) And you would need to set this to compute using the pane down. Then synchronise your axis and change the marks type of the second calculation to a line ( or a gannt if you need to take up the entire space and can't deal with slight breaks).
Next you will need to create a formula that provides the label you would be looking for. Something of this nature
IF LAST() = 0 THEN ATTR([Category]) + ' ' + STR(MIN(YEAR([Order Date]))) END
Then make sure this is on the label shelf of the table calculation's marks card and make sure it is computed using pane down.
That being said, yeah it is possible. But it's a bad idea. This is what tooltips and headers are for.
Thank you Carl. i can try in this way also.
But what if i didn't use Year field in the view and have to display year in the tool tip of reference line(Here Gantt bar) .