Forum Discussion

corbs's avatar
corbs
Frequent Visitor
2 years ago
Solved

SAMEPERIODLASTYEAR showing same sales amt

Hello Community!

I can really use some help. 

I normally use SAMEPERIODLASTYEAR formula when want to show last year info. But it is not working with this dataset - I tried everything, and I can't figure this out. 

This is the scenario:

I have a fact table that has TRANSACTION_DATE (I have this column being used as a slicer in the report), I don't have all the dates there, there are some gaps. 

So, I am creating a dimension table like this, and setting the relationship with the fact table. So far so good. 

Time Dim = CALENDAR(MIN(CONCUR_EXPENSE[TRANSACTION_DATE]),MAX(CONCUR_EXPENSE[TRANSACTION_DATE]))

 
Then, I have two metrics:
Approved Amount =
SUM(CONCUR_EXPENSE[APPROVED_AMOUNT])
 
Approved Amount LY =
CALCULATE(
    [Approved Amount],  
    SAMEPERIODLASTYEAR('Time Dim'[Date]))
 
But then, this is how the results is coming up, same value for both metrics. 
 

 Summarized for better understanding:

 

The model is pretty simple, only one fact and the time dimension that I've created. I really don't know what am I doing wrong. Can someone please help me?

  • Put the field from the dimension table in the visual, not the transaction date

1 Reply

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

    Put the field from the dimension table in the visual, not the transaction date