cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
naitiksoni Frequent Visitor
Frequent Visitor

Reference Line on x-axis

I have date on my x-axis of a Line chart.

I need a vertical reference line on a particular (dynamic) date to see if my trend line crossed that date or not.

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Reference Line on x-axis

Hi @naitiksoni

 

To draw the Vertical reference line is currently not possible. You can use bit of trick though. Use Shapes to create a static vertical line and it is not dynamic as explained. See the attached screenshot.

 

shapes.PNG

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Highlighted
Community Support Team
Community Support Team

Re: Reference Line on x-axis

Hi @naitiksoni,

 

A vertical reference line is not available now. To work around this requirement, you can try to use a combination chart.

  1. Create a "line and stacked column chart"
  2. Put column [date] into shared axis and put [values] into line values.
  3. Create a measure that evaluates to the maximum value when Date=specific date(otherwise blank), put this measure into column values.

Measures can be:

Reference line =
    IF (
        HASONEVALUE ( Table1[Date] ),
        IF (
            VALUES ( Table1[Date] ) = DATE ( 2016, 3, 1 ),
            MAXX ( ALL ( Table1[Date] ), MAX ( Table1[Sales] ) )
        )
    )

3.PNG

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
13 REPLIES 13
Super User
Super User

Re: Reference Line on x-axis

Hi @naitiksoni

 

To draw the Vertical reference line is currently not possible. You can use bit of trick though. Use Shapes to create a static vertical line and it is not dynamic as explained. See the attached screenshot.

 

shapes.PNG

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Highlighted
Community Support Team
Community Support Team

Re: Reference Line on x-axis

Hi @naitiksoni,

 

A vertical reference line is not available now. To work around this requirement, you can try to use a combination chart.

  1. Create a "line and stacked column chart"
  2. Put column [date] into shared axis and put [values] into line values.
  3. Create a measure that evaluates to the maximum value when Date=specific date(otherwise blank), put this measure into column values.

Measures can be:

Reference line =
    IF (
        HASONEVALUE ( Table1[Date] ),
        IF (
            VALUES ( Table1[Date] ) = DATE ( 2016, 3, 1 ),
            MAXX ( ALL ( Table1[Date] ), MAX ( Table1[Sales] ) )
        )
    )

3.PNG

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Reference Line on x-axis

It's lovely. Thanks Yuliana
Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
naitiksoni Frequent Visitor
Frequent Visitor

Re: Reference Line on x-axis

@v-yulgu-msft Thank you!

 

 

pschommer Regular Visitor
Regular Visitor

Re: Reference Line on x-axis

Thank you for providing this helpful solution to a similar problem I've had!

I implelemented it and it works as expected. Your screen shot, however, shows a very thin line (which I like) while mine is quite thick. I can't seem to find any formatting option that controls the width of the column(s).

 

Capture.PNG

Am I missing something? Can you please point me to this option?

Sha_Kri Frequent Visitor
Frequent Visitor

Re: Reference Line on x-axis

@pschommer, have you figured out how to make that separation column thinner?

pschommer Regular Visitor
Regular Visitor

Re: Reference Line on x-axis

My company has moved on from Power BI to Tableau. I don't recall if I figured out how to make the line thinner. It is of little concern to me right now. Best of luck to you.

klyhne Frequent Visitor
Frequent Visitor

Re: Reference Line on x-axis

@Sha_Kri if you change your X-Axis - Type to "Categorical" you can set the Inner padding to the maximum, which makes the columns thinner.

Only option I have found to far.

v-anabat Frequent Visitor
Frequent Visitor

Re: Reference Line on x-axis

I have a project with Production deployed to date, for this project, there are Incidents associated with it and for each incident, there is created date. My requirement is, I have to plot count of incidents based on their create date on X-Axis. But the challenge here is I have to include a vertical line on X-Axis based on Production deployed to date so that user will quickly identify when the project is deployed on production and he can quickly check how many incidents are raised before one month and after one month. Please help me know how can I achieve this.

requirement.PNG