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
Epinedo
Frequent Visitor

Last year comparison failed when using filters

Hello community, 

 

I need help to improve my sales report, currently I have a report which gives me the comparison between the current year (or whichever year is selected) and the previous year. It works perfect, but when I try to use any filter it crashes! I need to use a filter that helps me to see how the different sales rep are performing between years. My report is the following:

 

Captura.JPG

 

When I use the sales rep filter, it shows me the following error message:

 

Error.JPG

 

The formula that I'm using to calculate this is:

 

LY Sales = CALCULATE(SUM('Consolidado de Ventas'[Subtotal]),SAMEPERIODLASTYEAR('Consolidado de Ventas'[Fecha]), ALL('Consolidado de Ventas'))
 
Do you have any recommendation? I would be very thakful with your support. 
 
Erik
1 ACCEPTED SOLUTION

Any time intelligence functions, for example, SAMEPERIODLASTYEAR, work properly with a separate date table.  I encourage you to use one.

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

Do you have a date table?

It is a date column inside the sales table


@HotChilli wrote:

Do you have a date table?


 

Any time intelligence functions, for example, SAMEPERIODLASTYEAR, work properly with a separate date table.  I encourage you to use one.

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