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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DaxPadawan
Helper III
Helper III

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. 

3 REPLIES 3
v-xiaotang
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

vxiaotang_0-1672141401882.png

 

 

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.

amitchandak
Super User
Super User

@DaxPadawan , I think you need this

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

https://youtu.be/WSeZr_-MiTg

 

 

Other TI can help

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

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

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.