Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
corbs
Frequent Visitor

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. 
 
corbs_0-1716402424400.png

 Summarized for better understanding:

corbs_1-1716402475397.png

 

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?

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

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

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.