Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Date range in dynamic text box

Hi, how can I capture the dates selected in a text box, for example if users select date range of “01/01/2020” to “31/01/2020” for text box to say “Date range: 01/01/2020 to 31/01/2020”?
  • Hi Anonymous 

     

    Try this:

    Date Range =
    VAR __MIN =
        FORMAT ( MIN ( 'Table'[Date] ), "MM/DD/YYYY" )
    VAR __MAX =
        FORMAT ( MAX ( 'Table'[Date] ), "MM/DD/YYYY" )
    RETURN
        "Date Range: " & __MIN & " to " & __MAX
    

3 Replies

  • Hi Anonymous 

     

    Try this:

    Date Range =
    VAR __MIN =
        FORMAT ( MIN ( 'Table'[Date] ), "MM/DD/YYYY" )
    VAR __MAX =
        FORMAT ( MAX ( 'Table'[Date] ), "MM/DD/YYYY" )
    RETURN
        "Date Range: " & __MIN & " to " & __MAX
    
  • Anonymous , seem like danextian  has provided the solution. Please check and mark it as solution, if it worked for you

  • I've just stumbled across this in trying to solve my own problem.

     

    Is there a way of making this include days where no orders have been received? I have tried calculating the "minimum" dynamic value using my Orders table but this will exclude the first few days if no orders were received initially. I tried to do it on my Calendar table's date but then it brings back the earliest date in the calendar which is for a different site (i.e. not being filtered by the [Order Location] filter).

     

    Thanks.