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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello @Syndicate_Admin

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.