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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Show Hide events older then today

Hi all,

 

martysk_0-1726813082725.png

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?

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
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.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
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.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.