I have a dual axis chart which consists of bar chart and lines chart. As you can see on the image below, I have 3 lines and I would like to apply different label for each line but at the moment every label is applied to every line.
I would like to display:
- 2021 line - only [Sales 2021 % diff] label
- 2020 line - only [Sales 2020 % diff] label
- 2019 line - no label
It would be great if font colour of each label matched line colour
Attaching example workbook
Hi @Piotr Grobelny ,
Make a few adjustments to your calculated fields.
I created new measure as shown below;
{ INCLUDE WEEK([Dispatch Date]): SUM(IF YEAR([Dispatch Date]) = 2019 THEN [Sales] ELSEif
YEAR([Dispatch Date]) = 2020 THEN [Sales] ELSEIF YEAR([Dispatch Date]) = 2021 THEN [Sales] END)}
Then modified 2019 sales, 2020 sales, and 2021 Sales
2019 Sales
{ FIXED WEEK([Dispatch Date]): SUM(IF YEAR([Dispatch Date]) = 2019 THEN [Sales] ELSE 0 END)}
2020 sales
{ FIXED WEEK([Dispatch Date]): SUM(IF YEAR([Dispatch Date]) = 2020 THEN [Sales] ELSE 0 END)}
2021 sales
{ FIXED WEEK([Dispatch Date]): SUM(IF YEAR([Dispatch Date]) = 2021 THEN [Sales] ELSE 0 END)}
Then created another calculated field to handle the labeling.
{FIXED YEAR([Order Date]), WEEK([Dispatch Date]):min( IF YEAR([Dispatch Date]) = 2020 THEN [Sales 2020 % diff] ELSEIF
YEAR([Dispatch Date]) = 2021 THEN [Sales 2021 % diff] END)}
workbook attached for ref. I hope this helps.