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...
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.
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!