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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

incidence SAMEPERIODLASTYEAR

Good morning.

I am having certain incidents with SAMEPERIODLASTYEAR in which I would like to add amount from a year ago.

I currently have this variable:

D-H LY = CALCULATE(SUM(VIS_ALQ_PBI_Partides[Matter]), SAMEPERIODLASTYEAR(TablaFechas[FechaAsiento].[Date]))
But instead of returning the value of the "Prova" column, it always repeats the same value to me

xapogo_0-1677068682888.png

On the other hand, the content of the prova variable is correct, forcing the sum of the year 2021... but I would like with the function SAMEPERIODLASTYEAR

test = CALCULATE(SUM(VIS_ALQ_PBI_Partides[Matter]),VIS_ALQ_PBI_Partides[Exercise]=2021)
At the level of relationships, I would say that it is correct:
xapogo_1-1677068828919.png

I would appreciate your help in making me see what I am doing wrong.
Thank you.

2 REPLIES 2
amitchandak
Super User
Super User

@Syndicate_Admin , for time intelligence, always use date table join with date of your table 

 

D-H LY = CALCULATE(SUM(VIS_ALQ_PBI_Partides[Matter]), SAMEPERIODLASTYEAR(Date[Date]))

 

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.

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

Hello @Syndicate_Admin

The proposal you offer gives several errors. Is it possible that you are doing something wrong?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors