Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Year on Year Comparison with a Line Chart

Hello! What I want to do is to plot one year's worth of data vs another year on a line chart. 


My data is set up as a Value per Month. So in the Month column you have dates, assigned to the first day of each month (so February 2022 -> 01/02/2022). Value would be a decimal number. 


Ideally, I'd like to be able to choose any two specific years to compare, but if that would be too complicated, just choosing one year, and the previous year is automatically displayed, is fine too. 


I was thinking I'd have two parameters, where you can select a year, and two measures that select the values based on the parameters. Not sure how to make that work though, I am still confused between the parameters in Power BI and the parameters in Power Query. 

Community Support
Community Support

Hi @DaxPadawan 

Thanks for reaching out to us.

My suggestion is that you can create two separate date tables and put them into different slicers. Alternatively, you can just create a date table and then use measure to get the year before the selected date, the function can use edate() and so on, EDATE function (DAX) - DAX | Microsoft Learn




Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Super User
Super User

@DaxPadawan , I think you need this

Power BI Abstract Thesis: How to use two Date/Period slicers



Other TI can help


Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date:

Power BI — Year on Year with or Without Time Intelligence

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Hello @amitchandak! Thank you for this. If I understand correctly, the approach is to to create a separate Date table and use that for one of the slicers?

Helpful resources


2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.