Forum Discussion

joshuavd's avatar
joshuavd
Frequent Visitor
9 years ago
Solved

same period last year not working

I have been trying to create a SamePeriodLastYear() query but I am getting the same amount for the time period and wondering if someone could help me figure out what is wrong.  The pictures of the data model and my results are below:

 

Total Sales = Sum(Opportunity[Amount])
Total Sales LY = CALCULATE([Total Sales],SAMEPERIODLASTYEAR(Date_New[Date]))

 

  • joshuavd might be worth a shot, but i see you have a smart datekey in your table, is your relationship between the tables (ie sales data to date table )on the smart key ie 20110101 or the date field - if its on the smart key change it to the date field

4 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    joshuavd might be worth a shot, but i see you have a smart datekey in your table, is your relationship between the tables (ie sales data to date table )on the smart key ie 20110101 or the date field - if its on the smart key change it to the date field

    • joshuavd's avatar
      joshuavd
      Frequent Visitor
      I do have a date filter on the page that is only looking at 2017 (specifically 1/1/2017 - 6/30/2017). And the relationship is linked between sales close date (which is a short date format i.e. 1/15/2017) and the date field which is also a short date format (not the date key field)
      • joshuavd's avatar
        joshuavd
        Frequent Visitor
        Found the problem. My date filter was the sales close date and not the date table filter date. When I made that switch we're all good. Thanks!
  • *Try This*

    Keep a date slicer filter on the same page as that of a visual.

    Select a particular date range in the same year(like 2016-01-01 to 2016-12-31)