Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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.
Solved! Go to Solution.
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.
Hi @naitiksoni,
A vertical reference line is not available now. To work around this requirement, you can try to use a combination chart.
Measures can be:
Reference line = IF ( HASONEVALUE ( Table1[Date] ), IF ( VALUES ( Table1[Date] ) = DATE ( 2016, 3, 1 ), MAXX ( ALL ( Table1[Date] ), MAX ( Table1[Sales] ) ) ) )
Thanks,
Yuliana Gu
As an FYI here is a related idea to vote for:https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19550122-vertical-reference-lines...
Hi @naitiksoni,
A vertical reference line is not available now. To work around this requirement, you can try to use a combination chart.
Measures can be:
Reference line = IF ( HASONEVALUE ( Table1[Date] ), IF ( VALUES ( Table1[Date] ) = DATE ( 2016, 3, 1 ), MAXX ( ALL ( Table1[Date] ), MAX ( Table1[Sales] ) ) ) )
Thanks,
Yuliana Gu
Is there a way to get multiple vertical reference lines?
I tried this,
Reference line = IF ( HASONEVALUE( Query1[datetime] ), IF ( VALUES ( Query1[datetime] ) = DATESBETWEEN(Query2[DATE], DATE(2018,1,1), DATE(2018,12,31)), MAXX ( ALL ( Query1[datetime] ), MAX ( Query1[param1] ) ) ) )
I get further error,
Error Message: MdxScript(Model) (7, 43) Calculation error in measure 'Query1'[Reference line]: A table of multiple values was supplied where a single value was expected.
curious to see if you ever got this working.
I have a list of events that I'd like to reference as points or bars in my graphs. Keep thinking that this original formula for static ref points
Reference line = IF ( HASONEVALUE ( 'Date'[Date] ), IF ( VALUES ( 'Date'[Date] ) = DATE ( 2019, 03, 03), MAXX ( ALL ( 'Date'[Date] ), MAX ( WeeklyAnalysis[Actuals_CY] ) ) ) )
Hi @Anonymous
No, Unfortunately I didnt manage to get it to work
Matt
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.
Not sure if the issue is still open or not, but I recently had to tackle a similar issue. I saw that there was a way to use a combo chart to create the reference line with a measure, but you can't split your line chart into multiple categories with the combo chart, so that didn't meet my needs.
The best way I found to have a dynamic reference line was to overlap multiple visuals on top of each other.
The only downfall of this method is that, if you have new categories come into your data later, you will have to go back into your 3rd chart and make those new categories white.
Hope this helps!
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).
Am I missing something? Can you please point me to this option?
How did you get the vertical line to show on a multi-line chart?
I've seen this example on a combination chart but it only appears to work for multi-bar, single line combination and not the multi-line chart.
Hi
I know this is an old but did you manage to fiure our how to make the column thinner? Ive tried the padding but it doesnt change it enough for what I would like
Thanks
Matt
@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.
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.
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
141 | |
120 | |
112 | |
60 | |
59 |