Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Date Range Parameters

I have after date slicer and before date slicer on 'Date'[St_Date] and 'Date'[end_date] i want to show selected date

 

I have written an measure as below

 

Range= "From" & selectedvalue('Date'[St_Date]) & "to" selectedvalue('Date'[St_Date])

 

Output: From to

 

I want output: from 01/01/1900 to 31/12/9999

  • hi, Anonymous 

    For selectedvalue returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.

    You need to adjust your formula as below:

    Range = "From" & MIN('Date'[St_Date]) & "to" &MAX('Date'[end_date])

    Best Regards,

    Lin

     

5 Replies

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

    hi, Anonymous 

    For selectedvalue returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.

    You need to adjust your formula as below:

    Range = "From" & MIN('Date'[St_Date]) & "to" &MAX('Date'[end_date])

    Best Regards,

    Lin

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      This formula works but when user selects date before 2016(for eg. 01/01/2010 ) it is still showing 2016 cause my date table have relationship with other table"s effective date and it's minimum date is 2016.

      I can't make my relationship inactive between these two tables.

      So is there any way so that i can display whatever user selects the date in before/after date slicer.

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

        hi, Anonymous 

        If so, please adjust the formula as below:

        Range = "From" & MIN( "field in Start Date slicer" ) & "to" &MAX( "field in End Date slicer" )

        If not your case, please share your simple sample data with your expected output.

         

        Best Regards,

        Lin