Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dynamic Text Box with Date Range

Hi,   I would like to add a text box that  dynamically shows the rolling 12 month date range in my Month & Year page filter which is set to Relative Date, is in the last 12 calendar months.   For...
  • amitchandak's avatar
    3 years ago

    Anonymous , You can create a measure and use that in text box, make sure Q&A feature is enabled

     

    new measure =
    var _max = maxx(allselected(Date),Date[Date])
    var _min = eomonth(_max, -12) +1

    return

    "Rolling 12 Month " & _mn & " to " _max

  • Anonymous's avatar
    Anonymous
    3 years ago

    Managed to get this to work with date format in DD/MM/YYYY for UK format.

     

    Rolling 12Mth Title =
    VAR _Max = FORMAT(MAXX(ALLSELECTED(Dates),Dates[Date]),"DD/MM/YYYY")
    VAR _Min = EOMONTH(_MAX,-12)+1
    RETURN
    FORMAT(_Min,"DD/MM/YYYY")&" to "&_Max