cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MH3
Helper IV
Helper IV

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]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

7 REPLIES 7
amitchandak
Super User IV
Super User IV

@MH3 , Try a new measure like

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors