Forum Discussion

Epinedo's avatar
Epinedo
Frequent Visitor
7 years ago
Solved

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:

 

 

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

 

 

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
  • Any time intelligence functions, for example, SAMEPERIODLASTYEAR, work properly with a separate date table.  I encourage you to use one.

3 Replies

    • Epinedo's avatar
      Epinedo
      Frequent Visitor

      It is a date column inside the sales table


      HotChilli wrote:

      Do you have a date table?


       

      • HotChilli's avatar
        HotChilli
        Community Champion

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