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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ashmitp869
Post Partisan
Post Partisan

vertical line in Line Chart

Hi ,

How to add vertical line in Line Chart.

 

ashmitp869_0-1733697783299.png

 

1 ACCEPTED SOLUTION

You can add multiple constant lines referencing the dates that you want.

vnmadadimsft_0-1733814269752.png

 

vnmadadimsft_1-1733814269756.png

 

But you are not able to view the X axis constant line because your data type may be in string format please transform the data into date format or numeric format, then you will be able to view the x axis constant line. This will resolve your issue and you will be able to constant lines as required.
Thanks and regards.

View solution in original post

13 REPLIES 13
v-nmadadi-msft
Community Support
Community Support

Hi @ashmitp869 ,

We have not heard back from you if any answer has met your requirement kindly  Accept it as the solution  to help out other community members.

Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @ashmitp869 ,
Thank you for reaching out to Microsoft community support.


You can find X-Axis Constant Line and Y-Axis Constant Line in Visualizations – Analytics.

This feature will be available to numeric and date data types, but wont be available to text data type. We can transform text type to date type if possible to add constant lines but if that is not possible check the below steps.

vnmadadimsft_0-1733758987467.png

If you want to add a vertical line in a line chart, we don’t have a direct feature to do so for Text values but there is a good enough work around to do for your desired task.


-> Click on the Insert pane and click on shapes.

vnmadadimsft_1-1733759003435.png

 

->From there select the line chart

vnmadadimsft_2-1733759016494.png

->Click on the line chart and use format visual to rotate the line 90 degrees, we will obtain a vertical line.

vnmadadimsft_3-1733759029553.png

 


-> The resulting line is shown in the below picture

vnmadadimsft_4-1733759127209.png

 

->Please use that shape to overlay over your line chart visual wherever you want, For ex

vnmadadimsft_5-1733759127215.png

 



Please consider Accepting the solution if the provided answer meets your requirement so as to help other users or get back to us if you have further queries.


Thanks and Regards

I am not looking for a constant line but similar like this.

Every month

 

ashmitp869_0-1733778822680.png

 

hello @ashmitp869 

 

i might be mistaken but that picture looks like a vertical grid line to me.

Irwan_0-1733802091586.png

 

 

Thank you.

That's probably what OP is looking for unless he wants the line to be somewhere specific.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Wondering if you can help me to achieve the green lines.

ashmitp869_0-1733805030758.png

Providing a sample file.

https://github.com/suvechha/samplepbi/blob/main/sample_b.pbix

 

Currently it looks like 

ashmitp869_1-1733805076063.png

 

You can add multiple constant lines referencing the dates that you want.

vnmadadimsft_0-1733814269752.png

 

vnmadadimsft_1-1733814269756.png

 

But you are not able to view the X axis constant line because your data type may be in string format please transform the data into date format or numeric format, then you will be able to view the x axis constant line. This will resolve your issue and you will be able to constant lines as required.
Thanks and regards.

If you want the lines to be somewhere specific then you'll need to add several Y-Axis constant lines

danextian_0-1733805810376.png

Otherwise, you can enable the vertical gridlines.

danextian_1-1733805846738.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @ashmitp869 

 

Is this what you're looking for?

danextian_1-1733727961125.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I am not looking for a constant line but similar like this.

Every month

 

ashmitp869_0-1733778822680.png

 

You will need to add several constant lines to achieve that referring to different dates.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

When I am using line chart I don't an options of X Axis Constant line.

 

ashmitp869_0-1733792060889.png

When select Line and column stacked chart - don't have the X Axis Constant line.

 

ashmitp869_1-1733792166192.png

Any suggestions ?

Greg_Deckler
Community Champion
Community Champion

@ashmitp869 The Analytics pane only supports an X-axis constant line if you have a numeric x-axis. Otherwise, you just have to create a line shape and then overlay it. 😞



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors