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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Hello @Syndicate_Admin

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors