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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
L_B
Frequent Visitor

Reference line (vertical) to a specific date

Hi all,

 

I want to insert a vertical reference line to a specific date (e.g. Covid-19 beginning) on a line graph. 

I've seen an option whereby you could literally draw such a line but this is not the solution I am looking for.

 

Does anyone know a solution?

 

thanks,

L_B

 

 

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @L_B ,

 

I have a similar sample about it. Actually the vertical line in my sample is a column from Line and stack/clustered column chart. It hights the minium date in my sample. You could refrence it to have a try. Hope it can give you a few ideas.

Measure = 
var mindate = MINX(ALL('Table'),'Table'[Date])
return
IF(SELECTEDVALUE('Table'[Date]) = mindate,1)

v-xuding-msft_0-1598518221964.png

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
LloydDobler
Frequent Visitor

Impressive youtube vid with some coding.  It's a workaround, but should work great on a line chart.

 

https://www.youtube.com/watch?v=XKmTknbusnY

v-xuding-msft
Community Support
Community Support

Hi @L_B ,

 

I have a similar sample about it. Actually the vertical line in my sample is a column from Line and stack/clustered column chart. It hights the minium date in my sample. You could refrence it to have a try. Hope it can give you a few ideas.

Measure = 
var mindate = MINX(ALL('Table'),'Table'[Date])
return
IF(SELECTEDVALUE('Table'[Date]) = mindate,1)

v-xuding-msft_0-1598518221964.png

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@L_B , you can not have like. but on combo visual, you can bar. make sure it null on all other dates.

 

No same example but good idea

https://community.powerbi.com/t5/Community-Blog/Display-Label-Only-on-the-Last-Data-Point-of-the-Lin...

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

@L_B - I have never seen an "automatic" solution for this.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors