Forum Discussion

Tihannah's avatar
Tihannah
Icon for Resolver II rankResolver II
3 years ago

Calculating PY for TODAY

I created a measure to show today's results as the data will refresh hourly throughout the day.

 

My measure looks like this:

SALES - CALCULATE(SUM(Table[Sales]), FILTER('Date Table', 'Date Table'[Date]=TODAY()))
 
The measure is working fine, but I'm at a loss for getting PY. SAMEPERIODLASTYEAR is giving me EVERYTHING for last year instead of just the total for the same date last year OR nothing at all depending on how I write it. I've tried various DATEADDS with -1,YEAR combinations. I think the problem is with my original CY measure. Can someone please tell me what I'm doing wrong?  Thanks.

2 Replies