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

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors