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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bo_afk
Post Patron
Post Patron

Display data for same period last year

I currently have a line graph with week numbers on the x axis and sales on the y axis to see the sales trending over time. My data goes back a year so I have 2018 to 2019 data to-date.

 

I also have a slicer for dates if a user is only interested in a specific period.

 

Is it possible for someone to select a period in 2019, and for the line graph to also display the same period for 2018 as well?

 

Thanks

afk

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @bo_afk ,

 

You could use DATEADD and LOOKUPVALUE function to do it.

Here is the result.
4-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft 

 

Thanks for your suggestion. Whilst it works in your example, there are additions to my dataset. I have a number of other columns, which are namely categories, each with their own value for each date, thereby repeated dates. So therefore the formula is unable to do a lookup since there are multiple results of the value it's looking up.

 

Is there a way to do this via a measure as my data will be subject to slicers/filters so it won't remain static.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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