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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
E12345
Resolver II
Resolver II

Need a Dax Function to limit the page (or a slicer) to last three years, including current year

Hi!

I need help limiting my page to always dynamically pick up dates that include last three full years and current year.l

For example, if current year is 2023, I need the data to get 2023, plus year 2022, 2021 and 2020 - starting from 01/01/2020 (so three full years are picked up, plus current year)
I tried to use a relative date slicer, but it either lets you select last three "calendar" years - whicvh skips the current year, or last three years - which does not start from the beginning of the year.
I have a disconnected Date table with dates - how can I use a dax function to dymamically select that time segment? So far I could just set the filter to start with 01/01/2020 as a static date, but opnce we move into the year 2024, this date will not dunamically move to the next year,. I need a Dax to dymanically shift each year, to pick up last three full years and current year's data. THANKS!!!

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

try to do as in the screenshot
Screen Capture #548.pngScreen Capture #549.png

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

try to do as in the screenshot
Screen Capture #548.pngScreen Capture #549.png

Thank you so much, it worked like a charm! 😉

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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