Forum Discussion

ThaddeusB's avatar
ThaddeusB
Icon for Helper I rankHelper I
7 years ago
Solved

Prevent invalid date selection in slicer

Is there a way to prevent the selection of a date outside the valid range in a date slicer? 

 

In my visualization, a subset of the complete data is selected by default, so it is not immediately obvious what the min & max values are.  If the user selects a new date from the boxes, the pop-up calednar allows select of any date including well after the maximum or well before the minimum.  Of course selecting invalid dates does nothing, but it is not obvious to the user why.

 

I assume this an oversight in the way the slicer works, as I can't imagine it always lets you select any value whatsoever by design.  But thought I'd ask to see if there is a workaround.

6 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi ThaddeusB,

    From your description, I could not figure out the sentense "prevent the selection of a date outside the valid range in a date slicer", how could you select a date outside the range of a date slicer? Could you please post more detail information?

     

    Regards,

    Daniel He

    • ThaddeusB's avatar
      ThaddeusB
      Icon for Helper I rankHelper I

      v-danhe-msft  Sure, my calendar table has dates from 7/1/2015-9/30/2018.  I have a slicer visualization for this table. On my slicer visualization I have the slider turned off so it is just the date input boxes.  These boxes allow the user to select any date whatsoever.  It is not at all obvious to the user what the valid date range.  I would like either 1) the calendar to not sure invalid dates or 2) the date to automatically change back to the minimum date when an out of range date is selected.  Neither seems possible.

       

      • dedelman_clng's avatar
        dedelman_clng
        Icon for Community Champion rankCommunity Champion

        I don't know how your date table is currently built, but a date table built with CALENDARAUTO() will only have dates for years that span your data (so if your data is 7/1/2017-11/30/18, CALENDARAUTO() would have dates 1/1/17-12/31/18).  You could also use the CALENDAR() function to build the table and specify MIN(fact table date) and MAX(fact table date) so you only get exactly those dates (warning on this method is that some time intelligence functions may not work properly without a full year's worth of data in each year)

         

        You could also potentially use the date on your fact table as the field for the slicer (as opposed to the field in your date table), but that will depend on your model and whether or not you can/need to do a bi-directional crossfilter.

         

        Hope this helps

        David