Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Dynamic Reference Line

I have a line graph showing trend lines for prices of multiple commodities. I need a vertical reference line (dynamic) on this graph to differentiate between the current and forecast values on the X-axis of this graph. (For example, if I am viewing the graph in January 2021, the line should be placed between January and February 2021)
Using a combination chart is not working.
Is there any other way to achieve this?

  • Hi Anonymous ,

    You can create measure to calculate specific period values and show it in the line chart:

    Measure = 
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            'Table',
            'Table'[Category]
                IN DISTINCT ( 'Table'[Category] )
                    && 'Table'[Date].[MonthNo] >= MONTH ( TODAY () )
                    && 'Table'[Date].[MonthNo]
                        <= MONTH ( TODAY () ) + 1
        )
    )

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • create a measure that computes this, and add it to the visual values

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi Anonymous ,

    You can create measure to calculate specific period values and show it in the line chart:

    Measure = 
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            'Table',
            'Table'[Category]
                IN DISTINCT ( 'Table'[Category] )
                    && 'Table'[Date].[MonthNo] >= MONTH ( TODAY () )
                    && 'Table'[Date].[MonthNo]
                        <= MONTH ( TODAY () ) + 1
        )
    )

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.