cancel
Showing results for
Did you mean:
Helper II

## SamePeriodLastYear doesn't seem to be working

Hi, I've been trying to get my SamePeriodLastYear function to work without success.  I must be missing something I'm sure I'll be kicking myself for missing but I can't seem to produce the correct values

Using fake data, in this screen print,  I show august 21 sales data but there should be zero since I have no data for August 2020. I must be missing something in the calculation?
The screen print here shows the example, the data model and what the tables look like

Any help is appreciated.

1 ACCEPTED SOLUTION
Solution Sage

Instead of this , create a seaparate measure ,

Total Sales = SUM(TrackSales[SalesAmt]) and use this measure in                                     CALCULATE

10 REPLIES 10
Helper II

Thanks very much! It worked!

Helper II

Hi, I tried it and it wasn't successfull
Here's a screen print

Solution Sage

Also , the Month and Year in the columns of the Matrix visual, are they from the calendar table? Please ensure that they are from the calendar table

Helper II

the \$ are from the sales table, and all the date related fields are from the calendar table.

Solution Sage

I find that the Salesdate column is not of the 'Date' data type. In case the new mwasure does not work, please try changing the data type of Salesdate to 'Date' and try again.

Solution Sage

I find that the Salesdate column is not of the 'Date' data type. In case the new measure does not work, please try changing the data type of Salesdate to 'Date' and try again. Please ensure that both the related date columns are of the 'Date'  data type

Helper II

Hold on.  It does appear that it's working in the detail.  Here's the screen print
So it seems that using the correct date in the column seemed to have done the trick.

It looks like the detail is working but the total seems to be calculating the results in correctly

Wouldn't the totals be equa

Helper II

Thank you and I'll try that!

Solution Sage

You are welcome. Also I find that the Salesdate column is not of the 'Date' data type. In case the new mwasure does not work, please try changing the data type of Salesdate to 'Date' and try again.

Solution Sage

Instead of this , create a seaparate measure ,

Total Sales = SUM(TrackSales[SalesAmt]) and use this measure in                                     CALCULATE