- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Button to filter data to 5 years prior than current date
I need to add a button to my pbix that will filter all the data to 5 years older than the current date. Can someone show me how to accomplish this?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The button doesn't seem to be filtering the data. Did I miss a step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The one part that's missing is applying the measure as a filter. After creating the DAX Measure, you need to apply it as filter on your visual.
( Drag the measure into the filter pane of the visual and set the filter condition to show IsOlderThanFiveYears = 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

That worked, I got all the years prior to 5 from the current date. Now I also want to be able to choose specific years or all the years including the current year. The slicer that I have for the Year isn't working now that I have the Older than 5 Years button. Is it possible for me to have the button and the Year slicer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

So you want to be able to view the data for the last 5 years for the year you select and not just the current year?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I think I have this worked using two buttons/bookmarks. However I have one onther question. I have the report set up to refresh every night. Each morning when I select the Older than 5 Years button will the refreshed data be reflected in the report? The booksmarks aren't static data correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Yes, correct! The bookmarks in Power BI are not static. They capture the current state of your report, including the filters and slicers at the time they were created. When you refresh your data each night, the bookmarks will reflect the updated data the next morning.
So, when you select the "Older than 5 Years" button after the refresh, it will apply that filter to the most recent data available in your report.
Feel free to hit Accept as Solution if this conversation has helped 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

IsOlderThanFiveYears = IF( MAX(YourTable[YourDateColumn]) <= EDATE(TODAY(), -60), 1, 0 )
1. In the Modeling tab, create a New Measure using the above DAX. Use this measure to filer data in your desired visual/report.
2. Go to Report View >> Insert tab >> Button
3. In the Visualizations Pane, go to Actions toggle to ON. Set Type as Bookmark.
4. Add a bookmark and name "Olderthan5Years"

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
Anonymous
| 10-05-2018 10:31 AM | ||
06-05-2024 05:40 PM | |||
Anonymous
| 07-06-2023 01:48 PM | ||
10-11-2023 07:39 PM | |||
07-22-2024 12:54 PM |
User | Count |
---|---|
121 | |
104 | |
85 | |
52 | |
46 |