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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. 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_
Memorable Member
Memorable Member

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.