Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi,
I have a slicer visual (vertical list) that contains each year in my model. It currently dates from 1960 to 2055 and so each year between those dates is available to check on the slicer.
Is there a way where I can check the boxes for the current year and four previous years (i.e. 2020 - 2024) but still have all the other years showing but just unchecked? And as next year (2025) comes around, the slicer visual will default to checking only the years 2021-2025?
Thanks.
Solved! Go to Solution.
Hi @D_PBI
I have carefully considered the method you envisioned, and found that it is not feasible, and I can provide you with an alternative method
First, I created the following table
You can then construct your slicer using the following calculated columns
IsSelectedYear =
IF(
YEAR(TODAY()) - 'Table'[date].[Year] <= 4 && YEAR(TODAY()) - 'Table'[date].[Year] >= 0,
"Selected",
"Not Selected"
)
This formula can filter data from five years based on your current time
This is the result you want
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @D_PBI
I have carefully considered the method you envisioned, and found that it is not feasible, and I can provide you with an alternative method
First, I created the following table
You can then construct your slicer using the following calculated columns
IsSelectedYear =
IF(
YEAR(TODAY()) - 'Table'[date].[Year] <= 4 && YEAR(TODAY()) - 'Table'[date].[Year] >= 0,
"Selected",
"Not Selected"
)
This formula can filter data from five years based on your current time
This is the result you want
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous - thank you for your efforts but that isn't the end result I was hoping for. I also need all the other years present in the slicer visual but just unchecked.
Hi @D_PBI
The PBIX file I provided contains unchecked years, but I used a filter to hide them, and if you want to show all the years just unchecked, you can also drag the year field into the slicer.
This is the result you want.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Thanks for your follow up. Apologies, I didn't fully view your .pbix file the first time around. I see what you've done now. I guess by checking the 'Selected' parent chechbox, as each year turns the current year will automatically be checked as it falls within the 'Selected' year range.
not possible.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
64 | |
45 | |
42 | |
40 |