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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.