Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

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

michellerob2000_0-1728656633922.png

 

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

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
)

vkongfanfmsft_0-1729067751246.png

 

Best Regards,
Adamk Kong

View solution in original post

4 REPLIES 4
v-kongfanf-msft
Community Support
Community Support

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
)

vkongfanfmsft_0-1729067751246.png

 

Best Regards,
Adamk Kong

SamWiseOwl
Community Champion
Community Champion

@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.

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Community Champion
Community Champion

Hi @michellerob2000 

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

 

SamWiseOwl_0-1728656840124.png

 

Then you could have a chart with sales in Y axus, the years in the legend and Months in the X axis 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

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_0-1728657449272.png

michellerob2000_1-1728657472865.png

 

michellerob2000_2-1728657485319.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.