Forum Discussion

Mahadevaraobc's avatar
Mahadevaraobc
Icon for Helper II rankHelper II
7 years ago
Solved

Multiple year line in single line chart

Hi All, I have a column in yyyymm format, i have converted this to month format. How do i display multiple year as different line in single line chart? when i try to add year to legend field is sho...
  • kcantor's avatar
    7 years ago

    Mahadevaraobc 

    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.

  • kcantor's avatar
    kcantor
    7 years ago

    Mahadevaraobc 

    Put your months for your x axis. Then create the calculations and drop them on the chart.