Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Two Separate Date Selection

Hi,

I am willing to implement two drop downs for date selction: Start Date, End Date.

My page will have two types of vizes:

1. Viz only impacted by the End Date
2. Viz impacted by both Start Date and End Date

I am thinking of using filter to determine "End Date" for viz 1, and another filter for the duration between Start Date and End Date. But feel free to suggest the most efficient way to do that.

I have tried the slicer, but unfortunately for my use case, slicer is not ideal. The main reasons are:

1. I want to show the Start Date selection as: "From the end of month: <Start Date>" ... and it will only be a Month 'YY slection in the date selection.

2. The viz where only end date has impact, if I use a slicer, whenever I change the Start Date, this viz needs to load as well, I would like to avoid that.

If I can have two dates selection like below and can create a measure which flags any date between these selected dates - that would be awesome.

 



Many thanks.

  • Hi Anonymous ,

     

    You need two date tables. one for "From" and another for "To".

     

    Measure:

    V1 = IF(SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer2'[Date]),1)
    V2 = IF(SELECTEDVALUE('Fact table'[Date])>=MIN('Slicer1'[Date]) && SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer2'[Date]),1)
     

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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

4 Replies

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

    Hi Anonymous ,

     

    I suggest you use two date table. One for slicer and another for your fact table. The slicer date table ( i mean which table's date column is used for slicer) is just used to input parameters for measure.

     

    For example, the viz only contains date column in it.

     

    V1 = IF(SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer'[Date]),1)

    V2 = IF(SELECTEDVALUE('Fact table'[Date])>=MIN('Slicer'[Date]) && SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer'[Date]),1)
     
    If i misunderstood you, please let me know.
     

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

    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 for your effort v-chenwuz-msft 

      What I am looking for is to have two separate date selectors like this:



      However, I could not create a measure which will give me all the dates in between the dates selected on From and To boxes above ...

       





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

        Hi Anonymous ,

         

        You need two date tables. one for "From" and another for "To".

         

        Measure:

        V1 = IF(SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer2'[Date]),1)
        V2 = IF(SELECTEDVALUE('Fact table'[Date])>=MIN('Slicer1'[Date]) && SELECTEDVALUE('Fact table'[Date])<=MAX('Slicer2'[Date]),1)
         

        Pbix in the end you can refer.

        Best Regards

        Community Support Team _ chenwu zhu

         

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