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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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 REPLY 1
HotChilli
Super User
Super User

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

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.