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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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