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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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.

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.

Hi,

 

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

 

Thanks for your help

Matt

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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