Forum Discussion
Multiple Lines on One Chart
Hey Everyone,
I am trying to put 2 lines on one chart from 2 different tables to compare data over 2 years. Seperately, they are:
and
When I attempt to put them on one chart I get:
As you can see, the data points are all wrong.
Below is the data I am using.
What am I doing incorrectly?
Regards
- Anonymous2 years ago
Thanks for the reply from arava and ahadkarimi.
Hi e175429 ,
When using the 2024 PLEA field as the x-axis, it seems to appear as you would expect, but on closer comparison, the data is incorrect.I will provide an alternative method and here are the steps to do it:
1.Create a new table, this table contains unique PLEA column values extracted from 2023 and 2024 (Sheet1):Newtable = SUMMARIZE ( UNION ( SELECTCOLUMNS ( '2023', "PLEA", '2023'[PLEA] ), SELECTCOLUMNS ( '2024(Sheet1)', "PLEA", '2024(Sheet1)'[PLEA] ) ), [PLEA] )2.The relationship between the three tables is created as shown below:
3.Using the PLEA of the newly created table as the x-axis, you can get a line graph with the correct data:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
15 Replies
- aravaRegular Visitor
Hello! Line charts are meant to be used for quantitative, ordered values. I might suggest a clustered column chart to tell your story more intuitively.
- e175429Helper IV
Hello. So, I actually get the same result using the columns LIKELY from the attached files.
2023:
2024:
But when I put them together:
- aravaRegular Visitor
The attached files are not publicly available and the suggestion was to change the visual itself, not change the inputs
- ahadkarimiSolution Specialist
- e175429Helper IV
Hi ahadkarimi,
Please try again.
2023
https://1drv.ms/x/s!Aop4ARcj8m8hgQTArIQ07rOUmCyd
2024
https://1drv.ms/x/s!Aop4ARcj8m8hgQeMN1GH0X29SBMJ
Thank you kindly
- ahadkarimiSolution Specialist
Hi e175429, thank you for sharing the files. When I connected the two table IDs in the Model view, it showed the lines perfectly in one chart. Do you not want a relationship between the two tables?
- e175429Helper IV
.