Forum Discussion

Budfudder's avatar
Budfudder
Icon for Helper IV rankHelper IV
7 years ago

Get Dates From Date Slicer

I'm trying to get the dates which are set on a Date slicer, but I'm having problems.

 

My data table consists of various items, each with a date. But the dates are scattered widely - there might be an item with a date of 1/1/70, and the next item (chronologically) might be 1/1/75.

 

The problem is that all the methods I've tried return not the date selected in the slicer, but the earliest entry in the table that fits into the slicer range.

 

For example, using the two dates above, if I set the earliest date on the slicer to 1/1/73 and then use:

 

StartDate = CALCULATE(MIN(Table[Date Field]), ALLSELECTED(Table[Date Field]) )
or just
StartDate = MIN(Table[Date Field])
 
the value I get is not 1/1/73 but 1/1/75 - the date of the earliest row in the table that fits into the slicer. I want to get the first date of the slicer itself. Is this possible?

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Budfudder,

     

    I think you need to confirm there not contain any available fielder on your date fields, otherwise it will also affect allselected functions.

     

    AFAIK, power bi use 'and' logic to apply multiple filters on datasource. So if you have two filter effects: 'large than 1/1/73' and 'larger than 1/1/75', it will combine these filters to get 'larger than 1/1/75 results'.

     

    Regards,

    Xiaoxin Sheng

    • Budfudder's avatar
      Budfudder
      Icon for Helper IV rankHelper IV

      But I do not have two filters - just one.