Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
zahirmohideen
Helper I
Helper I

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @zahirmohideen 

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

vyaningymsft_0-1715075932416.png
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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @zahirmohideen 

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

vyaningymsft_0-1715075932416.png
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

amitchandak
Super User
Super User

@zahirmohideen , You can use following

 

Measure  =

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

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

return

<Your measure code>

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.