Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How add moving horizontal line in graph?

Hi,   I want to have certain periods of time marked in my chart based on certain events happening during a certain period. I have data from various countries and amount of tourists per month. I wan...
  • v-lionel-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    "What I need is : IF('Tourism'[Year]) = Event[Year]); 10; blank(), showing multiple horizontal lines based on the events a country had. "

    You can do like this:

    // Creaet column in Tourism table
    Column = 
    VAR x = 
    LOOKUPVALUE(
        Event[Year],
        Event[Year], Tourism[Year]
    )
    RETURN
    IF(
        [Year] = x,
        10, BLANK()
    )

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.