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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Finnair
Advocate I
Advocate I

How to get the CHOSEN start and end points of time slider (slicer)?

I have a data table (Mytable) with Modified date column. I need to get the start and end parameters of the slider eg. points that are chosen (not the start/end of the scale).

 

I have tried this chosen start:

ChosenStart = CALCULATE(MIN(Mytable[Modified].[Date]), ALLSELECTED(Mytable[Modified].[Date]))
 
But this gives me only the start date of the year.
 
What would be the right formula?

 

1 ACCEPTED SOLUTION

Hi, @Finnair 

ChosenStart = CALCULATE(MIN(Mytable[Modified].[Date]), ALLSELECTED(Mytable[Modified].[Date]))

Is Mytable[Modified] the date field you are currently using?

You should use Mytable[Modified].[Date] rather than Mytable[Modified] here to get  the chosen start and end points of time slider.

 

ChosenStart = MIN(Mytable[Modified])
ChosenEnd = Max(Mytable[Modified])

 

veasonfmsft_0-1652430967014.png

Please check my sample file for more details.

Best Regards,
Community Support Team _ Eason

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Finnair , Not very clear. Example to get mon nad max value on a range slicer

 

new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])

return

calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

Thank you @amitchandak 

 

With your var_max I get maxdate correctly.

 

My slider is a "between" slider.

 

With var_min I don't get the mindate.

Hi, @Finnair 

ChosenStart = CALCULATE(MIN(Mytable[Modified].[Date]), ALLSELECTED(Mytable[Modified].[Date]))

Is Mytable[Modified] the date field you are currently using?

You should use Mytable[Modified].[Date] rather than Mytable[Modified] here to get  the chosen start and end points of time slider.

 

ChosenStart = MIN(Mytable[Modified])
ChosenEnd = Max(Mytable[Modified])

 

veasonfmsft_0-1652430967014.png

Please check my sample file for more details.

Best Regards,
Community Support Team _ Eason

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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