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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MH3
Helper V
Helper V

LY Measure Showing Data on the Calendar Year with No Data

Hi,

I have a sample dataset which have data for the year 2017 and 2018 approx 1KK total records.

When I use LY Measure the measure shows the LY for 2017 on 2018 and 2018's value on 2019.

 But, there is no Data for 2019 in the dataset, then why the measure is showing 2018 LY data over 2019? 

 

I'm confused, The LY Measure as I know should show data on the year which have data in it? 
LY.png
Any Solution?

1 ACCEPTED SOLUTION

@MH3 , Row context issue

Try like

Sumx(Values('Date'[year]), if(isblank([Net Amount]), blank(), [Total Sales Last year]))

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@MH3 , Try a new measure like

if(isblank([Net Amount]), blank(), [Total Sales Last year])

Hi @amitchandak ,

I have used your formula but there is one problem.

The NetAmLY, Total shows 257,274,651 Why is it showing like that?  

LY updated.png

@MH3 , Row context issue

Try like

Sumx(Values('Date'[year]), if(isblank([Net Amount]), blank(), [Total Sales Last year]))

Hi @amitchandak ,

Well it's fixed, but I have one confusion why the last year measure previously shows data of 2018 over 2019 (if there is no data on that year it should not show that as I know).
But it was showing the 2018's Data is it correct or a error?

@MH3 , for LY usually we mobe dates a year back. So this measure has data. and both measures work independently, so any one of the measures that has a data; the visual table will show data.

Hi @amitchandak ,

As I have understood, The LY measure has 2018's Data in it, because the Sameperiodlastyear function calculates the value for the last year. as ithe dataset has the data till 2018.

 

So, the LY Measure should calculate data for 2017 over 2018 only.


But the NetAmt measure is just sum of two years of that's why it was showing the LY measure over 2019? 
correct me if I am wrong

Hi, @MH3 

I agree with your idea, because the SAMEPERIODLASTYEAR() function is indeed used in conjunction with the calendar table, so the measure will also operate within the date range.

More info about the SAMEPERIODLASTYEAR() function in DAX

 

What’s more, if amitchandak’s reply has helped you to solve this problem, would you like to mark his reply as a solution so that others can learn from it too?

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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