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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
Memorable Member
Memorable Member

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors