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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Invisibleman
Helper II
Helper II

sameperiodlastyear result in blank page when de-selecting year inbetween

Dear all,

 

I have in my power bi, 4 years. Where I am getting the previous year's value also. However, if I de-select a middle year, then I am getting the white field, so there's an error.

 

As you can see below on the picture. As you can see I can select sequencel years, but I can't de-select a middle year.

 

I have tried with sameperiodlastyear and also with dateadd minus 1 year, the problem remains.

Ithe formula I have is;

Revenue All Years 1 year earlier =
    calculate(
        'Calculations Sales Report Related'[Revenue All Years],
        (SAMEPERIODLASTYEAR(mapCalendar[Date])))
 
I can do with the (SAMEPERIODLASTYEAR(ALL(mapCalendar[Date]))) but then it shows me the total value of it all in each year. But I want to keep that only the values of that year is shown.

Year problem.jpg

 

If anybody could help with this?

 

Thanks,

Hans

2 REPLIES 2
Wilson_
Super User
Super User

Hello Invisibleman,

 

The issue is SAMEPERIODLASTYEAR (and most/all date functions only work with an unbroken, continuous date range. Check out this previous post and see if it helps.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hello Wilson,

 

Sorry for the late reply. But I have checked and tried the solution. But that is not something that will work for my needs. As it seems that it will copy the needed data to a temp table. But this is not something I wish to do, as there are too many fields that I will need to copy. 

But if there's a way to skip the error, then I am also okay. Even that if that wil mean, that it will not show the value.

 

Regards,

Hans

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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