Forum Discussion

bvy's avatar
bvy
Helper V
5 years ago

Vertical Event Lines on a Trend Graph (Line Chart)

We are using a line chart to show trends over time -- dates along the X axis, metrics along Y. Pretty straightforward. We have a request to show vertical lines on specific dates (on the X axis) to represent an event -- a plant closure, process change, whatever. These events will come from a table (columns: date, event_text). The user might hover over the vertical line to see event text as a tooltip, or maybe it's accessible some other way.

 

The line chart allows adding constant lines, but I need something dynamic, even if it's a hack, such as overlapping visuals with the top one transparent. Third party visuals are only an option for us if they are PBI Certified.

 

Slight rant, but our users are tired of hearing Power BI can't do that. This particular request isn't far fetched at all, and my searching indicates that it comes up a lot. Still I can't find an accpetable, sustainable solution.

 

Here are some YouTube videos that almost deliver. The first one uses bars (can't be sized), the second uses points on the trend line (data is hard coded in DAX).
https://www.youtube.com/watch?v=6OgJX21cgMg
https://www.youtube.com/watch?v=XKmTknbusnY

 

I'm eager to hear your ideas. Thank you.

4 Replies

  • DataZoe's avatar
    DataZoe
    Microsoft Employee

    bvy You can do this with a combo chart:

    I added a table called Events with the date and description, then did a Events = DISTINCTCOUNT(Events[Event]) for a measure. I used that for bars.


    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi bvy is it possible to create a line chart with 3 vertical event lines, and user can move those event lines through a date slider ?

    • liosc's avatar
      liosc
      New Member

      Thanks.
      With "combo chart" do you mean "Line and stacked column chart"?