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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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