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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
imagautham
Helper II
Helper II

How to Add an vertical line on the Line chart?

Hi All,

 

I'm an newbie to Power BI. I have the following requirement

In the below Line chart, in X axis we have month name and Y axis we have total Sales measure.

I have to add a vertical line to every data point of a month. 

Im not sure how to do that. Can anyone help?line_chart.png

8 REPLIES 8
mark_timmis
Frequent Visitor

Hello

You've probably worked it out now but you can only add vertical gridlines if the x-axis variable is numeric. I see yours are month names, which was the same requirement as me when I discovered this.

ddpl
Solution Sage
Solution Sage

@imagautham try below combo chart

 

ddpl_0-1660026951146.png

 

Note: drop the column under Line y axis which you have added under Y axis as per below

ddpl_1-1660027071417.png

 

and increase the column tranperancy as per below

ddpl_2-1660027141997.png

 

Everybody might have found a work around to this now, but in recent updates Power BI has added a reference line option.

CorneGeyser_0-1683627948069.png

Add a new line, choose the X-Axis Constant Line and then create a measure that will move with a value on your x-axis. In my case I used today's date as my value.

CorneGeyser_1-1683628068501.pngCorneGeyser_2-1683628096667.png

 

@ddpl  I tried this. But this is not enough to make it a thin line.

I found a way to do this. There is an Error bars option in Analytics pane through which I created 2 measures.

One for Lower Bound which i assigned value as 0

Then another measure for upper bound and assigned value as 15000 (which is according to my data)

Then I added these measures into Lower and Upper bound under Error bars.

Then I got the vertical line

ddpl
Solution Sage
Solution Sage

@imagautham try this

 

ddpl_0-1659960092741.png

 

@ddpl  Thanks for the response.

But I'm unable to find vertical option under Gridlines in my visualization.

 

line_chart_2.png

@imagautham change the X axis  category as per below then check

 

ddpl_0-1659961477127.png

 

@ddpl  I get that when I add like the way you suggested. But When I drill down into month level, The vertical option is disabled

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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