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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

SAMEPERIODLASTYEAR - Not showing data for last year, instead shows same data

 Hello

I have created measure as follows -

PrevSales =
CALCULATE(SUM(FactInternetSales[SalesAmount]), SAMEPERIODLASTYEAR(DimDate[FullDateAlternateKey].[Date]))

 

However, it is not showing data for last year. Instead it shows same data. Below is the screenshot -SAMEPERIODLASTYEAR.JPG

 

 

 

 

 

 

 

 

 

 

 

Any idea on this?

 

Regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

Please drag year/date field of your DimDate table to table visual along with the PrevSales measure. You will get incorrect result if you drag year/date field of FactInternetSales table into table visual.

Regards,
Lydia

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Anonymous,

Please drag year/date field of your DimDate table to table visual along with the PrevSales measure. You will get incorrect result if you drag year/date field of FactInternetSales table into table visual.

Regards,
Lydia

dujos
Helper I
Helper I

Hello vmakhija,

 

First try to remove .[Date] in the end of your formula.

 

Below an example of the formula of mine:

 

 

PrevSales = CALCULATE([Total Sales]; SAMEPERIODLASTYEAR('Calendar'[Date]))

 

 

Anonymous
Not applicable

@dujos

Tried that. It gives all blanks for some reason -SAMEPERIODLASTYEAR1.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards

vmakhija, your data type on FactInternetSales[OrderDate] is the same of DimDate[FullDateAlternateKey]?

 

img3.png

 

 

 

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Users online (9,711)