cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
james_pease
Helper II
Helper II

LY Sales Measure is displaying current year sales

Hello everyone, I created a measure for last year sales and plan to do the same for 2 years back. I created the following measure:

 

LY Sales = CALCULATE(Sum(Cotti_Coupon[Sales]), SAMEPERIODLASTYEAR(Date_Value[DateValue].[Date]))
 
Does anyone know why the LY Sales are displaying the values for the the current year instead of LY?
james_pease_0-1665072260301.png
I am expecting to see the following values in the LY column
james_pease_2-1665072392250.png

Here are my relationships. As you can see, store #s are connected to a master store list, and dates are connected to a date table

james_pease_3-1665072469237.png

Thank you in advance!

1 ACCEPTED SOLUTION

And your date table is marked as such ?

 

View solution in original post

5 REPLIES 5
AilleryO
Super User
Super User

Hi,

 

Since you have a date table, you should use the date of your date table and not the one from the fact table.

One more thing do not forget to mark your date table as a date table, and to link (seems done on your screencopy).

But the stange thing is that you might have forgotten something, because if your date is related to your date table or coming from the date table, you should not see the date hierarchy (Date.Year or Date.Month...).

So that's why I'm guessing your table is not marked or linked properly 😉

Let us know

Sorry, Yes I selected the Date column from the Coupon table, but even when I select the date from the date table, the values for LY = current sales

james_pease_1-1665072968507.png

 

Here are the relationships

james_pease_2-1665073028437.png

 

 

 

And your date table is marked as such ?

 

WOW thank you, I feel dumb.

No worries it happens to all of us...

and dumbness is well shared amongst all of us, with an equal distribution 😉

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors