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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Fossil1974
Frequent Visitor

Showing x-axis reference lines only when filter is selected

I have the following problem:

 

I want to display in a line chart different dates (DD/MM/YYYY) using x-axis reference lines. The visual shows three measures over a period of time which you can filter for a specific event (filter named "LeadSourceDetail") on the left side.

 

Please find the below screenshot for your reference:

2022-08-18 13_15_36-Truck_Evaluation_FN - Power BI Desktop.png

I am using three reference lines to display the exact date for the specific event (middle reference lines) an two other reference lines to display the date +3 month after (right hand reference line) and -3 month before (left hand reference line) the exact event date.

 

When I filter for a specific event ("LeadSouceDetail") the visual displays the right dates for the three reference lines as you can see in the first screenshot above.

 

But when I do not apply the filter, the visual displays wrong dates for the reference lines (picking the dates of the very first event in the dataset), as you can see in the second screenshot below:

2022-08-18 13_14_42-Truck_Evaluation_FN - Power BI Desktop.png

 

I know that you can write a measure to display nothing in a visual when a filter is not applied, but this works only in relation with measures. Since the reference lines are not based on measures, I wonder if there is a way to not show the reference lines if nothing is selected in the filter but still showing the measures ?

 

In addition, it would be extremely useful not to show the reference lines when multiple events are selected in the filter, as this would also show the wrong dates for the reference line in the visual.

2 REPLIES 2
amitchandak
Super User
Super User

@Fossil1974 , In case of X-axis and y-axis constant line , you uase a measure using fx option

 

You can have a measure like

 

if( calculate(isfiltered(Table[Lead source details]), allselected()) , #date(2022,10,01), blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Sorry, but I do not understand your idea. Could you elaborate further about your idea? Thanks !

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Kudoed Authors