Forum Discussion

bella769's avatar
bella769
Frequent Visitor
5 years ago

Default slicer date

Hi 

I have a date slicer which looks like this 

and my dashboard is refreshed daily with the date/time shown

 

does anyone know how to get the slicer to automatically select the date the refresh took place.  At the moment it is a manual process where the slicer has to be updated everyday.  I've tried istoday, relative date, but this then only gives the option of one date and I want the other dates to still be an option.  I've also datediff/generateseries to bring a date range with today as the max date, but this still requires manual selection of the date after refresh. 

 

Is this actually possible or am I wasting my time?

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello @bella769

    Currently we would not be able to add a measure in the slicer so that today's date is automatically filtered, however, we could create a measure in your visual to achieve your goal.

    I build a sample table:

    1.png

    Create a dimdata table.

    Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

    Theb construct a measure, drag it to the filter field, and set it to display items when it is not blank.

    Measure = 
    VAR _SEL = SELECTEDVALUE('Date'[Date])
    VAR _Date = IF(ISFILTERED('Date'[Date]),_SEL,TODAY())
    VAR _Result = IF(MAX('Table'[Date])=_Date,1,BLANK())
    RETURN
    _Result

    The result is as shown below, it will display the values currently by default, and you can use slicer to display values on different dates.

    2.png

    You can download the pbix file from this link: Default targeting date

    Best regards

    Rico Zhou

    If this post helps,then consider Accepting it as the solution to help other members find it faster.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi bella769 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Best Regards,

    Rico Zhou