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
shashicr7
Regular Visitor

Error in creating last year sales measure using SAMEPERIODLASTYEAR function.

Hi, I have a measure

LY Sales = CALCULATE([Sales_Amount Measure], SAMEPERIODLASTYEAR('PDW_DATE_D'[CAL_DATE]))

 

but is giving the following error:

An invalid numeric representation of date value was encountered.

 

also,column CAL_DATE is of datatype:Date (example : 2019-01-07)

 
1 REPLY 1
DAXRichArd
Resolver I
Resolver I

Hi shashicr7,

PBI Report Server has some limitations. One limitation is with time intelligence functions. There are work arounds but I haven't figured it out yet. A key word search I'm using is 'advanced time intelligence' but I haven't found an exact solution yet. Sorry I couldn't help. The key here is you will find as I have that Report Server has some limitations with not accepting specific functions. There are work arounds but you have to research older publications before a function (for example SAMEPERIODLASTYEAR) was introduced. If I find anything I'll update this post.

Rich Ard

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.