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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MKBE
New Member

SAMEPERIODLASTYEAR not working

Hi

 

I have an issue with the function SAMEPERIODLASTYEAR

I have reduced my dataset to the minimum to clear all potential inteferences but still

 

My measure :

Revenue Y-1 = CALCULATE(SUM('DWH FactImpressions'[AdserverRevenueRTB]), SAMEPERIODLASTYEAR('DimDate'[DateTime]))
 
DimDate contains all dates in 2023 and 2024
MKBE_1-1715005132409.png   MKBE_2-1715005157823.png

 

It's link to the Fact on DimPublicityDateId = DimDateID
I have 2023 data 
MKBE_0-1715005102112.png
 
The model 
MKBE_3-1715005292813.png

 

 

But the outcome is the following one :

 

MKBE_4-1715005340028.png

 

Thanks for your help

Matt

 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@MKBE , Seems strange

 

Make sure Year in visual is coming from DimDate

DimDate is Marked as Date Table 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@MKBE , Seems strange

 

Make sure Year in visual is coming from DimDate

DimDate is Marked as Date Table 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,

 

Indeed after defining the table as Date Table in the model it worked

 

Thanks for your help

Matt

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.