Forum Discussion

acmo's avatar
acmo
Regular Visitor
3 years ago
Solved

Date Slicer default value

Hi all!

 

We are using the date slicer in many of our reports. However, there is a case where, instead of having the whole interval of dates, we want to see by default only the date of the last entries. For instance: we have n different dates. By default, the visual will select the interval oldest(n) - most_recent(n)  but in this case we only want most_recent(n) - most_recent(n). Moreover, we don't want to lose data. I mean, the slicer should be ready to filter values based on user's demands.

 

Do you know any approach to do that?

 

Thank you in advance.

 

Kind regards!

4 Replies

  • acmo , Not very clear, but do want something like

     

    new measure =
    var _max = maxx(allselected(Date),Date[Date])
    var _min = minx(allselected(Date),Date[Date])
    return
    calculate( sum(Table[Value]), filter('Date', 'Date'[Date] =_max)) - calculate( sum(Table[Value]), filter('Date', 'Date'[Date] =_min))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi acmo ,

    I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting.

    Thanks for your efforts & time in advance.

     

    Best regards,
    Community Support Team_ Binbin Yu

    • acmo's avatar
      acmo
      Regular Visitor

      We have a report with a temporary window, for example from August 4th to August 20th.
      In order to filter by dates, we use the default component of power bi with the calendar functionality:

       

       

      The data in the report is updated automatically every day, so, on August 21st we will have the data for the August 20th available (our time window increases).
      Whenever we open the report, by default, we want to display data from the last available day (without having to filter manually).
      In summary, we want, that when we open the report on the August 21st, to automatically see the data for August 20th, when opening the report on August 27th, see the data for August 26th and so on but
      taking into account that the functionality of being able to manually filter a time window (for example from January 30th to February 13th) must still work.

       

      Kind regards.