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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors