Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

dynamic text box using filtered date

Hello, 

 

I would like to create a text box to add a title for my report which includes the dates applied in the date filter.
The title would look like "Results between XX/XX/XXXX and XX/XX/XXXX"

Thank you for your help
Pauline

  • Hi, Anonymous 

     

    Please try to write the below DAX measure for your title.

     

    Titlename =
    "Results between " & MIN( dates[Date]) & " and " & MAX(dates[Date])
     

    Jihwan Kim

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

     
     
  • Hi, Anonymous 

    According to your description, I think you can create a measure and set the text box title as the value of the measure to achieve this, you can try my steps:

    1. Create a measure like this:
    Title =
    var _min=MINX(ALLSELECTED('Date'),[Date])
    var _max=MAXX(ALLSELECTED('Date'),[Date])
    return
    "Results between "&_min&" and "&_max
    1. Add a text box and set the title like this:

    And add a date slicer to your page, then you can get what you want, like this:

     

    You can download my test pbix file here

     

    Best Regards,

    Community Support Team _Robert Qin

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

5 Replies

  • Hi, Anonymous 

     

    Please try to write the below DAX measure for your title.

     

    Titlename =
    "Results between " & MIN( dates[Date]) & " and " & MAX(dates[Date])
     

    Jihwan Kim

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

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

    Hi, Anonymous 

    According to your description, I think you can create a measure and set the text box title as the value of the measure to achieve this, you can try my steps:

    1. Create a measure like this:
    Title =
    var _min=MINX(ALLSELECTED('Date'),[Date])
    var _max=MAXX(ALLSELECTED('Date'),[Date])
    return
    "Results between "&_min&" and "&_max
    1. Add a text box and set the title like this:

    And add a date slicer to your page, then you can get what you want, like this:

     

    You can download my test pbix file here

     

    Best Regards,

    Community Support Team _Robert Qin

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks v-robertq-msft and Jihwan_Kim 

    It works but it's a shame that we have to create a measure for each chart title if we want it to be different.

    Have a nice day

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

      Hi, 

      Sorry, my OneDrive account has been expired and the pbix file has been deleted.

       

      Best Regards,

      Community Support Team _Robert Qin

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