Forum Discussion

zahirmohideen's avatar
2 years ago
Solved

Value from Slicer ( with "Between" Style)

Hello All 

 

In my report , I have a slicer for "Sales Date"  in a "between style".

How do I retrieve the "From Date"  to "To Date" in to  a variable ?

 

Thanks

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, zahirmohideen 

    You can try amitchandak way. If it does not work, you can try the following DAX.


    DAX:

    startDate = CALCULATE(MIN('Date'[Date]),ALLSELECTED('Date'))
    
    endDate = CALCULATE(MAX('Date'[Date]),ALLSELECTED('Date'))
    

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

  • zahirmohideen , You can use following

     

    Measure  =

    var _max = maxx(allselected(Date), Date[Date])

    var _min = minx(allselected(Date), Date[Date])

    return

    <Your measure code>