Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Annotating graph with events

I have a graph that's plotted with a Date Table with MMM-YYYY as the x-axis (shown below):

 

I want to add annotations to it via the tooltips but need some help.

I created another table with events and MMM-YYYY and was wondering whether I can use this table to annotate the graph above.

  • Hi Anonymous ,

     

    We can create a inactive relationship between tables based on _Date table [_Date(months)] and Event table[_Event Date(Month)]. Then we can use the measure as tooltips to work on.

     

    tooltip= CALCULATE (MAX(Event table[Event]),userelationship (_Date table [_Date(months)],Event table[_Event Date(Month)]))

     

     

4 Replies

  • The information you have provided is not making the problem clear to me.

    But if you date table is at date level and you trying to join the data to MMM-YYYY column from another table which data in MMM-YYYY format, that will create Many to Many. Better would be

     

    Create date in another table

    Date = "01-" & Table[Month Year] // Only if it is in MMM-YYYY format.

    Change data type of this as date. And Join using This new date to date table

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Sure, you could do something like the following. Obviously I do not know your tables and code but hopefully this gets the idea across.

     

    ToolTip Measure = 
    VAR __Date = MAX('Date Table'[Date])
    RETURN
      CONCANTENATEX(
        FILTER(
          'Events',
          [EventDate] = __Date
        ),
        [Description],
        ","
      )
          

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Tried both proposed solutions but neither worked.

     

    The events table that I have is an excel spreadsheet with 2 main columns: Event Date and Event.

     

    I want to be able to hover over or click on a given month/year in the graph and have some annotation in the tooltips.

     

    Here's the date table I have:

     

    And here's the events table:

     

     

    If I were to select/hover over the spike in the orange line right before 2018 (which would be Dec 2017), I want the tooltips to display "Dim Screen"

    • v-frfei-msft's avatar
      v-frfei-msft
      Community Support

      Hi Anonymous ,

       

      We can create a inactive relationship between tables based on _Date table [_Date(months)] and Event table[_Event Date(Month)]. Then we can use the measure as tooltips to work on.

       

      tooltip= CALCULATE (MAX(Event table[Event]),userelationship (_Date table [_Date(months)],Event table[_Event Date(Month)]))