top of page

Adding a vertical line or marker to a chart in Power BI

Updated: Nov 14

A business user came to me asking “how can I get a vertical line on Line Chart in Power BI like my Excel report?”. I was like, “It’s straightforward. We've this analytics pane which lets you add so many types of lines 😊 “. But, quite quickly I understood, I can't draw a vertical line as we do in Excel or SSRS.

Adding a vertical line or marker to a chart in Power BI

Data looks like below:

Screenshot 1 of 8 showing adding vertical line

The user wants a marker, ideally a line to point those events on the chart. I can't think of an out the box option, but there are some workarounds. Let’s look at adding a line using Combo Chart. This chart clearly shows events as bars and tooltips can define what kind of event it was. I would prefer to change the bar width. It’s a bar; it’s not exactly a line; however, it fits for the purpose.

Screenshot 2 of 8 showing adding vertical line

Next using Markers:

With latest Power BI update, We can set line stroke width to zero. So I decided to use that feature to highlight the events on the chart. It’s a simple Line Chart with one axis and two values. One value is to show the Value column and other to show Count of Event. My chart looks like this:

Screenshot 3 of 8 showing adding vertical line

Then I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, setThen I updated X Axis type to Categorical (Otherwise, Markers functionality won't be available). Then under Shapes, set

Screenshot 4 of 8 showing adding vertical line
Screenshot 5 of 8 showing adding vertical line
Screenshot 6 of 8 showing adding vertical line

Then I decreased Stoke width to 0 and increased Marker size to 16. Now the chart looks like this:

Screenshot 7 of 8 showing adding vertical line

Tooltip don’t make much sense, but by using new Report tool tip pagesFunctionality we can have much more helpful and user-friendly tooltip like below:

Screenshot 8 of 8 showing adding vertical line

Hope this post helps someone out there

Prathy 🙂

Comments


bottom of page