Forum Discussion

Amir851's avatar
Amir851
Icon for Helper I rankHelper I
7 years ago
Solved

Dynamic date vertical reference line or a dot in a line chart

How Can I add a dynamic or constant date vertical reference line in a line chart , where x axis will be date value, y will be actual component value and after that date reference line, color of that particular line should be changed to red. I know how to do this in Tableau but I want this in Power BI

  • hi, Amir851

    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 like this, put this measure into column values.

    Measures can be:

    Measure 2 = 
    IF(SELECTEDVALUE('Table'[Date])=TODAY()-15,1)

    Result;

     

    Best Regards,

    Lin

     

     

2 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, Amir851

    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 like this, put this measure into column values.

    Measures can be:

    Measure 2 = 
    IF(SELECTEDVALUE('Table'[Date])=TODAY()-15,1)

    Result;

     

    Best Regards,

    Lin

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      hello, do you mind elaborating on what is the -15 means in your measure ?and also what 1 refer to. 

       

      IF(SELECTEDVALUE('Table'[Date])=TODAY()-15,1)