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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MatthewCunliffe
New Member

SamesPeriodLastYear vs Using Var + Return

Hi there!

I've recently completed a finance-oriented course on DAX and Power Pivot/BI. 

When calculating sales growth in dollar $ terms the instructor offered 2 different solutions, but with a different outcome:

Measure 1SalesPY:=CALCULATE([Sales],SAMEPERIODLASTYEAR(Dim_Dates[Date]))

Measure 2: 

Sales$Growth:=var PYSales = CALCULATE([Sales],SAMEPERIODLASTYEAR(Dim_Dates[Date]))

return [Sales] - PYSales

 

The outcome is different one from the other. 
Thanks in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @MatthewCunliffe 

Because they are two different calculations. The 2nd measure returns the difference between the current year and the previous year which is clearly indicated by the measure name.

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @MatthewCunliffe 

Because they are two different calculations. The 2nd measure returns the difference between the current year and the previous year which is clearly indicated by the measure name.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.