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
squarecat
Helper I
Helper I

Error when trying to calculate YoY% last year doesn't match previous year

Hello everyone, I'm going crazy trying to figure out what am I doing wrong when attempting to calculate YoY%. I started trying to sum up all the values in the [Saldos] column that are marked as "Ingresos" in the [Tipo] column with the following measure:

 

 

Ingresos =
CALCULATE(SUM('Base datos'[Saldos]),
'Base datos'[Tipo] = "Ingresos")

 

 

This apparently works fine, so I use the new measure to calculate [Ingresos] for last year with the dateadd function:

 

 

Ingresos LY = 
CALCULATE(CALCULATE([Ingresos],
DATEADD(Calendario[Date], -1, YEAR)))

 

 

It seems to work fine for every year except the last, that should be 5,725,873.31 but is short by more than a million, so I can't calculate YoY% because the last year doesn't have the correct value

squarecat_0-1729067418801.png

Where am I going wrong?

1 ACCEPTED SOLUTION
MNedix
Super User
Super User

Heya,

Have you tried:

Ingresos LY = 
CALCULATE([Ingresos],PREVIOUSYEAR('Date'[Date]))


If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

View solution in original post

6 REPLIES 6
Kedar_Pande
Super User
Super User

@squarecat 

Ingresos measure looks good.

 

Ingresos LY = 
CALCULATE(
[Ingresos],
SAMEPERIODLASTYEAR(Calendario[Date])
)
YoY% = 
IF(
NOT(ISBLANK([Ingresos LY])),
DIVIDE([Ingresos] - [Ingresos LY], [Ingresos LY])
)

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

squarecat_0-1729087989339.png

Tried it but still shows wrong value

Bibiano_Geraldo
Super User
Super User

Try the folowing DAX:

Ingresos LY =
CALCULATE([Ingresos],
SAMEPERIODLASTYEAR(Calendario[Date])
)

if this answer help you, please, mark it as solution.

squarecat_0-1729088068391.png

Wrong value still

MNedix
Super User
Super User

Heya,

Have you tried:

Ingresos LY = 
CALCULATE([Ingresos],PREVIOUSYEAR('Date'[Date]))


If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

This is the solution, thank you very much!

squarecat_0-1729088190836.png

 

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.

Top Solution Authors
Top Kudoed Authors