Forum Discussion
Line chart for different countries for different period
Hi everyone,
I need to show 5 coutnries in a line chart with actual, and forecast. Actual being the solid lines, and forecast being the dotted lines. When I add the countries to the legend, i can get 5 lines of course, but then I can not get the solid and dotted lines. When I add the Actual/Forecast to the legend, then I dont have the country details. Is there a way to have something similar to below?
Thanks for the help,
4 Replies
- HotChilli
Community Champion
Sample data please
- AnonymousNot applicable
Here is a sample data
Country Year Month Month Nr Forecast/Actual Value Germany 2023 Jan 1 Actual 372 Germany 2023 Feb 2 Actual 395 Germany 2023 Mar 3 Actual 417 Germany 2023 Apr 4 Actual 438 Germany 2023 May 5 Actual 472 Germany 2023 Jun 6 Actual 509 Germany 2023 Jul 7 Actual 555 Germany 2023 Aug 8 Actual 592 Germany 2023 Sep 9 Actual 650 Germany 2023 Oct 10 Actual 725 Germany 2023 Oct 10 Forecast 692 Germany 2023 Nov 11 Forecast 733 Germany 2023 Dec 12 Forecast 764 Germany 2024 Jan 1 Forecast 801 Germany 2024 Feb 2 Forecast 834 Germany 2024 Mar 3 Forecast 873 Germany 2024 Apr 4 Forecast 982 Germany 2024 May 5 Forecast 1020 Germany 2024 Jun 6 Forecast 1056 Germany 2024 Jul 7 Forecast 1097 Germany 2024 Aug 8 Forecast 1212 Germany 2024 Sep 9 Forecast 1256 Germany 2024 Oct 10 Forecast 1293 Germany 2024 Nov 11 Forecast 1339 Germany 2024 Dec 12 Forecast 1466 Italy 2023 Jan 1 Actual 123 Italy 2023 Feb 2 Actual 143 Italy 2023 Mar 3 Actual 170 Italy 2023 Apr 4 Actual 206 Italy 2023 May 5 Actual 248 Italy 2023 Jun 6 Actual 292 Italy 2023 Jul 7 Actual 324 Italy 2023 Aug 8 Actual 323 Italy 2023 Sep 9 Actual 359 Italy 2023 Oct 10 Actual 394 Italy 2023 Oct 10 Forecast 417 Italy 2023 Nov 11 Forecast 479 Italy 2023 Dec 12 Forecast 513 Italy 2024 Jan 1 Forecast 555 Italy 2024 Feb 2 Forecast 600 Italy 2024 Mar 3 Forecast 631 Italy 2024 Apr 4 Forecast 749 Italy 2024 May 5 Forecast 794 Italy 2024 Jun 6 Forecast 837 Italy 2024 Jul 7 Forecast 867 Italy 2024 Aug 8 Forecast 985 Italy 2024 Sep 9 Forecast 1026 Italy 2024 Oct 10 Forecast 1032 Italy 2024 Nov 11 Forecast 1103 Italy 2024 Dec 12 Forecast 1221
- HotChilli
Community Champion
Generally, the way to get around the limitations of the line chart is to write separate measures for the values. So you might start with 2 measures: one summing the Actuals and one summing Forecast. Put them both in the Y-axis section. You can change the line type in the 'format' section (dotted or solid, for example).
It would be great to put Country in the Legend but it won't let you. You can use Small multiples or add a Country slicer if required.
---
There's an alternative solution if you re-organise the data :
https://exceleratorbi.com.au/plotting-2-columns-on-the-legend-of-a-chart/
Have a look at these and see how you get on
- AnonymousNot applicable
Thanks for the reply,
Yes unfortuantely it didnt solve the problem. I hope they fix it soon.