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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Remove constant x line if date not within slicer range button

Hello,

 

I have this graph, with the slicer on the right hand side selecting for dates.

TBDRW_0-1657029489305.png

 

The line there is a dynamic line from a measure with the code 'Today()', i.e. the dotted blue line is always on today.

I need either:

  • A button to turn off the constant x line
  • The x line to automatically turn off if not contained within the slicer's range

How can I acheive this? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a measure and use in x-axis constant line using FX

 

if(Today() >= minx(allselected('Date'), 'Date'[Date])  && Today() <= maxx(allselected('Date'), 'Date'[Date]) , today() , blank())

 

for buttons consider Bookmarks and buttons

Bookmarks
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I have no bookmarks pane in my powerbi desktop. How can I enable it? 

@Anonymous , check under the view tab(in the top ribbon)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Anonymous , You can create a measure and use in x-axis constant line using FX

 

if(Today() >= minx(allselected('Date'), 'Date'[Date])  && Today() <= maxx(allselected('Date'), 'Date'[Date]) , today() , blank())

 

for buttons consider Bookmarks and buttons

Bookmarks
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.