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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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