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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
MRN8840
Helper I
Helper I

Same period last year visual

Hi!

 

I have this chart showing the water consumption for the last 15 days (red marking):

 

Lastyear.PNG

 

I would like to add a chart for the same 15 days last year (blue line). Can someone please explain to me how to do that? 🙂

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @MRN8840 

 

You can use Measure like below.

Sales Last Year = 
CALCULATE(
    [Sales],
    SAMEPERIODLASTYEAR( 'Calendar'[Date] )
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

Thank you so much for you reply!

 

It almost works - I would like it to automatically show the same day last year (today 21. of january), and the previous 15 days - just like the chart. How to write that in DAX? 😕

Mariusz
Community Champion
Community Champion

Hi @MRN8840 

 

Use your Previous 15 days measure as the first argument of calculate.

CALCULATE(
    [Previous 15 days],
    SAMEPERIODLASTYEAR( 'Calendar'[Date] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Thanks again 🙂

 

I'm not completely understanding. You wrote that I should use my Previous 15 day measure as an argument, but the the 15 day measure in my screenshot is just a filter on the trend? 🙂

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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