Forum Discussion

michellerob2000's avatar
1 year ago
Solved

Compare over two years data

Im trying to create a line chart to compare no of tickets raised monthly over the two years. Ive tried to do it. I cant do it, really need some advice here.
Thanks

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi michellerob2000 ,

     

    My question is, if you compare the number of work orders for two years on the same axis, how should the x-axis be determined? Is it possible to explain this so that I can answer it for you as soon as possible.

    Tickets_CurrentYear = 
    CALCULATE(
        SUM(Tickets[Tickets]),
        YEAR(Tickets[Date]) = YEAR(TODAY())
    )
    Tickets_LastYear = 
    CALCULATE(
        SUM(Tickets[Tickets]),
        YEAR(Tickets[Date]) = YEAR(TODAY()) - 1
    )

     

    Best Regards,
    Adamk Kong

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi michellerob2000 ,

     

    My question is, if you compare the number of work orders for two years on the same axis, how should the x-axis be determined? Is it possible to explain this so that I can answer it for you as soon as possible.

    Tickets_CurrentYear = 
    CALCULATE(
        SUM(Tickets[Tickets]),
        YEAR(Tickets[Date]) = YEAR(TODAY())
    )
    Tickets_LastYear = 
    CALCULATE(
        SUM(Tickets[Tickets]),
        YEAR(Tickets[Date]) = YEAR(TODAY()) - 1
    )

     

    Best Regards,
    Adamk Kong

  • Hi michellerob2000 

    Since the data is the same, could you Append the two tables together in the Query Editor (Transform Data)

     

     

    Then you could have a chart with sales in Y axus, the years in the legend and Months in the X axis ğŸ™‚

    • michellerob2000's avatar
      michellerob2000
      Helper I

      Ive managed to append so thanks, but then i need to add the createddate from the 2023 table (should have 2024 data in tis too) but it doesnt work

       

       

  • michellerob2000  you need to add your ticket column into the Y axis.

    I would put

    Months in the X axis.

    Years in the Legend.

    TickedID or something else in the Y-axis to count.