Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
Ive made a gantt from my dataset above.
I would like to add button to filter Show or Hide past events (phases).
Show - All the events
Hide - hide the events where END DATE is older then current date (today).
Ive tried similar solution, (link) but couldnt figure it out.
Can anyone help,please?
Solved! Go to Solution.
@Anonymous , Try below method
Create a Date Table: Ensure you have a date table in your Power BI model. If not, you can create one using DAX:
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[End Date]))
Add a Calculated Column: Add a calculated column to your dataset to determine if the event is past or not:
IsPastEvent = IF('YourTable'[End Date] < TODAY(), "Past", "Future")
Create a Slicer: Add a slicer to your report and use the IsPastEvent column. This slicer will allow you to filter between past and future events.
Create Buttons:
Show All Events Button:
Insert a button from the "Insert" menu.
Set the button action to "Bookmark".
Create a bookmark that shows all events and link it to this button.
Hide Past Events Button:
Insert another button.
Set the button action to "Bookmark".
Create a bookmark that filters out past events and link it to this button.
Set Up Bookmarks:
Create a bookmark for showing all events.
Create another bookmark for hiding past events by applying a filter on the IsPastEvent column to only show "Future" events.
Link Buttons to Bookmarks:
Select the "Show All Events" button, go to the "Action" pane, and link it to the bookmark that shows all events.
Select the "Hide Past Events" button, go to the "Action" pane, and link it to the bookmark that hides past events.
Proud to be a Super User! |
|
@Anonymous , Try below method
Create a Date Table: Ensure you have a date table in your Power BI model. If not, you can create one using DAX:
DateTable = CALENDAR(MIN('YourTable'[Start Date]), MAX('YourTable'[End Date]))
Add a Calculated Column: Add a calculated column to your dataset to determine if the event is past or not:
IsPastEvent = IF('YourTable'[End Date] < TODAY(), "Past", "Future")
Create a Slicer: Add a slicer to your report and use the IsPastEvent column. This slicer will allow you to filter between past and future events.
Create Buttons:
Show All Events Button:
Insert a button from the "Insert" menu.
Set the button action to "Bookmark".
Create a bookmark that shows all events and link it to this button.
Hide Past Events Button:
Insert another button.
Set the button action to "Bookmark".
Create a bookmark that filters out past events and link it to this button.
Set Up Bookmarks:
Create a bookmark for showing all events.
Create another bookmark for hiding past events by applying a filter on the IsPastEvent column to only show "Future" events.
Link Buttons to Bookmarks:
Select the "Show All Events" button, go to the "Action" pane, and link it to the bookmark that shows all events.
Select the "Hide Past Events" button, go to the "Action" pane, and link it to the bookmark that hides past events.
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 7 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |