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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kurt4597
Helper I
Helper I

YoY on a graph

I am trying to create a year on graph from the following tables

 

Table 1: DateDim

Kurt4597_0-1684934982740.png


Table 2: Sales

Kurt4597_1-1684935022125.png

I will have the date on the datedim filter set as follows

Kurt4597_2-1684935463565.png

 

and the graph would look like this

Kurt4597_3-1684935498289.png

 

 

I am struggling on a way to do this. I could create a YoY measure but then plotting it on a graph is what I am stuck with. Any help would be much appreciated! Thank you all

 

Sample File - https://easyupload.io/lacpf5

 

1 ACCEPTED SOLUTION
Syk
Super User
Super User

Your previous year measure would be something like this

PY Sales = CALCULATE(SUM(Sales[Count]),DATEADD(Dim_date[Date],-1,year))

View solution in original post

3 REPLIES 3
Syk
Super User
Super User

Your previous year measure would be something like this

PY Sales = CALCULATE(SUM(Sales[Count]),DATEADD(Dim_date[Date],-1,year))
Syk
Super User
Super User

You can create this with measures or you can use the month and days as the axis (without year) and use year as the legend.

Syk_0-1684938288101.png

 

The issue I have with this method is that because the date filter only shows May 01/05/2023 - 21/05/2023 then it will filter out the line from previous year. Because of this, I think it is best to use a measure. Could you please assist?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.