Forum Discussion

mshaivitz's avatar
mshaivitz
Frequent Visitor
7 years ago

Annotating in a Line Chart with

Hi - I'm using this tutorial as the basis for adding an annotation.
https://community.powerbi.com/t5/Webinars-and-Video-Gallery/Annotating-Specific-Events-in-Line-Charts/m-p/151665#M20

 

I am using a Slicer to display information by city. What I want to show is 'implemention begins' in each of the 31 cities in the Slicer. 

 

 

I have:

 

Note =
SWITCH(
MAX(India[reportingdate] ), 
VALUE("10/1/2017" ), "Implementation begins in <<FILTERED CITY NAME>>",
VALUE("04/1/2018" ), "Implementation begins in <<FILTERED CITY NAME>>",
VALUE("05/1/2018" ), "Implementation begins in <<FILTERED CITY NAME>>",
BLANK()
)
 
I'm not sure how to bring in the name of the filtered city (or if you can even do that with VALUE function). I also explored the SELECTEDVALUE function, but I'm not sure if that is correct. 

Thank you. 
 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    You should be able to do something like:

     

     

    Note = 
    VAR __city = MAX('Table'[City])
    RETURN
    SWITCH(
    MAX(India[reportingdate] ), 
    VALUE("10/1/2017" ), "Implementation begins in " & __city,
    VALUE("04/1/2018" ), "Implementation begins in " & __city,
    VALUE("05/1/2018" ), "Implementation begins in " & __city,
    BLANK()
    )
    • mshaivitz's avatar
      mshaivitz
      Frequent Visitor

      HI Greg, thank you so much, this is working. I'm wondering if you could help me around two issues I'm having:

       

      1) When all the filters are selected, it shows a few random implementation dates - is this an IF statement, such as 'IF ALL Filters are selected, then show no dates"?

       

      2) What would I need to do to show multiple start dates if more than one filter is selected?

       

      Thank you, I appreciate your time.