Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is a sample data

      CountryYearMonthMonth NrForecast/ActualValue
      Germany2023Jan1Actual372
      Germany2023Feb2Actual395
      Germany2023Mar3Actual417
      Germany2023Apr4Actual438
      Germany2023May5Actual472
      Germany2023Jun6Actual509
      Germany2023Jul7Actual555
      Germany2023Aug8Actual592
      Germany2023Sep9Actual650
      Germany2023Oct10Actual725
      Germany2023Oct10Forecast692
      Germany2023Nov11Forecast733
      Germany2023Dec12Forecast764
      Germany2024Jan1Forecast801
      Germany2024Feb2Forecast834
      Germany2024Mar3Forecast873
      Germany2024Apr4Forecast982
      Germany2024May5Forecast1020
      Germany2024Jun6Forecast1056
      Germany2024Jul7Forecast1097
      Germany2024Aug8Forecast1212
      Germany2024Sep9Forecast1256
      Germany2024Oct10Forecast1293
      Germany2024Nov11Forecast1339
      Germany2024Dec12Forecast1466
      Italy2023Jan1Actual123
      Italy2023Feb2Actual143
      Italy2023Mar3Actual170
      Italy2023Apr4Actual206
      Italy2023May5Actual248
      Italy2023Jun6Actual292
      Italy2023Jul7Actual324
      Italy2023Aug8Actual323
      Italy2023Sep9Actual359
      Italy2023Oct10Actual394
      Italy2023Oct10Forecast417
      Italy2023Nov11Forecast479
      Italy2023Dec12Forecast513
      Italy2024Jan1Forecast555
      Italy2024Feb2Forecast600
      Italy2024Mar3Forecast631
      Italy2024Apr4Forecast749
      Italy2024May5Forecast794
      Italy2024Jun6Forecast837
      Italy2024Jul7Forecast867
      Italy2024Aug8Forecast985
      Italy2024Sep9Forecast1026
      Italy2024Oct10Forecast1032
      Italy2024Nov11Forecast1103
      Italy2024Dec12Forecast1221
  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity 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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reply,

       

      Yes unfortuantely it didnt solve the problem. I hope they fix it soon.