Forum Discussion
Multiple year line in single line chart
- 7 years ago
You will need to create different calculations for each year to display the way you request.
This Year Sales = SUM(FactTable[LineSales])
Last Year Sales = CALCULATE([This Year Sales], DATEADD(Date[DateKey], -1, year))
2 Yr Prior Sales = CALCULATE([This Year Sales], DATEADD(Date[DateKey], -2, year))
Then drop these as measures on the visual using your date table month column for the axis.
If I have misunderstood your question, please provide some sample data and more information on the solution you are hoping to see.
- 7 years ago
Put your months for your x axis. Then create the calculations and drop them on the chart.
Hi kcantor,
Thanks for replying.
My data looks like this.
Row Labels201720182019Grand TotalGrand Total241204229674
| 201701 | 19 | 19 | ||
| 201702 | 29 | 29 | ||
| 201703 | 30 | 30 | ||
| 201704 | 19 | 19 | ||
| 201705 | 18 | 18 | ||
| 201706 | 14 | 14 | ||
| 201707 | 23 | 23 | ||
| 201708 | 17 | 17 | ||
| 201709 | 10 | 10 | ||
| 201710 | 6 | 6 | ||
| 201711 | 36 | 36 | ||
| 201712 | 20 | 20 | ||
| 201801 | 19 | 19 | ||
| 201802 | 29 | 29 | ||
| 201803 | 30 | 30 | ||
| 201804 | 19 | 19 | ||
| 201805 | 18 | 18 | ||
| 201806 | 14 | 14 | ||
| 201807 | 23 | 23 | ||
| 201808 | 17 | 17 | ||
| 201809 | 10 | 10 | ||
| 201810 | 6 | 6 | ||
| 201811 | 13 | 13 | ||
| 201812 | 6 | 6 | ||
| 201901 | 25 | 25 | ||
| 201902 | 29 | 29 | ||
| 201903 | 30 | 30 | ||
| 201904 | 19 | 19 | ||
| 201905 | 18 | 18 | ||
| 201906 | 33 | 33 | ||
| 201907 | 23 | 23 | ||
| 201908 | 17 | 17 | ||
| 201909 | 10 | 10 | ||
| 201910 | 6 | 6 | ||
| 201911 | 13 | 13 | ||
| 201912 | 6 | 6 |
and my chart comes like this .
But i want the all years in different line. how do i do that.
Thank You.
Put your months for your x axis. Then create the calculations and drop them on the chart.