March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
The button doesn't seem to be filtering the data. Did I miss a step?
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)
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?
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?
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?
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 🙂
Thanks for your help!
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"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |