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
Anonymous
Not applicable

Previous Year vs SAMEPERIODLASTYEAR

Hi Guys,

 

Could you suggest which would be the best practice to choose between(previous year vs sameperiodlastyear) to calculate the sale for Last year? bit Confused.

 

Regards,

RSD

2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Previousyear: This function returns all dates from the previous year given the latest date in the input parameter. For example, if the latest date in the dates argument refers to the year 2009, then this function returns all dates for the year of 2008, up to the specified year_end_date.

 

SAMEPERIODLASTYEAR: Returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.

 

So as @LivioLanzo said, to use which one is up to your circumstance.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Hi,

 

Yes.  SAMEPERIODLASTYEAR() would be the best choice there.  You may also want to review my post here - Show sales only for corresponding months in prior years.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Previousyear: This function returns all dates from the previous year given the latest date in the input parameter. For example, if the latest date in the dates argument refers to the year 2009, then this function returns all dates for the year of 2008, up to the specified year_end_date.

 

SAMEPERIODLASTYEAR: Returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.

 

So as @LivioLanzo said, to use which one is up to your circumstance.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thanks Frank!!

LivioLanzo
Solution Sage
Solution Sage

it depends on your goal, normally 'sameperiodlastyear' is used but in some circumstances you may want to use 'previousyear'

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Thanks Mate!!

 

So If I want to create a measure to calculate the year-to-date sales and to compare those sales to the
previous year for the same time period then SAMEPERIODLAST YEAR is the best choice right? 

Hi,

 

Yes.  SAMEPERIODLASTYEAR() would be the best choice there.  You may also want to review my post here - Show sales only for corresponding months in prior years.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks @Ashish_Mathur!!! Much Appreciated!!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.