Forum Discussion

vanessafvg's avatar
vanessafvg
Icon for Community Champion rankCommunity Champion
9 years ago

Previous year calculations bring back current year values :/ - help

I posted this in another thread but highlighted the issue of it not plotting correctly on a line graph - however the issue actually is both of these calcutions ie

 

 

PY Revenue = CALCULATE([Revenue], SAMEPERIODLASTYEAR(all('Fiscal Date'[Date])))

PY 2 = CALCULATE([Revenue], PARALLELPERIOD(ALL('Fiscal Date'[Date]), -1, YEAR))

 

bring back exaclty the same data as this

Revenue = (CALCULATE(Sum(Registrations[MRR])) + CALCULATE(sum(Sales[RevenueNettAmount])))

 

what am i doing wrong, could this be a cross fact issue.  I have 2 facts linking  together through dimensions.  However its only the date dimension that is the linking bit for these 2 which has a one to many relationship for each fact in a single direction.

 

 

 

15 Replies

  • Remove the ALL function call inside the SAMEPERIODLASTYEAR and PARALLELPERIOD calls.  

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

      i had that previously but it brings back nothing - its because i have this filter on my dashboard

       

      this is what i have changed to 

      PY Revenue = CALCULATE([Revenue], SAMEPERIODLASTYEAR('Fiscal Date'[Date]))

      PY 2 = CALCULATE([Revenue], PARALLELPERIOD('Fiscal Date'[Date], -1, YEAR))

      and as you can see now its empty when i change this, i am baffled... 

       

       

       

      • mattbrice's avatar
        mattbrice
        Icon for Solution Sage rankSolution Sage

        Does your 'Fiscal Date' have dates in it for the prior fiscal year(it must for time intelligence to work)? Is your 'Fiscal Date' calendar table related to the fact table via columns of type Date?   if not, can you try this:

         

        PY Revenue = CALCULATE([Revenue], SAMEPERIODLASTYEAR('Fiscal Date'[Date]), ALL('Fiscal Calendar') )