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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Morgan2000
Frequent Visitor

Different Dates Same Graph

Hi,

I was wondering if anyone would be able to help, I have the below 2 graphs which show the last 12 months from the date selected or when the data goes to. E.g. Data is in up until June 2023 so will show June 2023 - July 2022. A rolling 12 months.

 

I also have another graph which is a 'comparison year' showing the same. For example, you select 2020 and it shows June 2020 - July 2019

 

Is there a way I can get this to show on one graph but keep it being 'July' at the start like the graphs are showing? I can't add a year filter as it causes the data to be split. Has anyone got any suggestions? 

 

Morgan2000_0-1690903370466.png

 

1 REPLY 1
Syk
Resident Rockstar
Resident Rockstar

You can create 2 measures for this and add them both on the graph. 
First measure would be..

PAX = sum(table[pax]) //or whatever your calculation is

Then, to get the previous year, we would reference the above measure.

PAX Previous Year = CALCULATE([PAX],dateadd(datetable[date],-1,year))

 

If you can go through the calculation of how you get your PAX line, we can get you an actual dax expression to calculate it.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.