cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors