web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / variable to set latest...
Power Apps
Unanswered

variable to set latest date and earliest date

(1) ShareShare
ReportReport
Posted on by 557

I'm trying to set a slider so that I can use that to filter by created date in my data.  How can I set a variable to earliest date and latest date in my created date column?  

Categories:
I have the same question (0)
  • Verified answer
    Mitanshu Profile Picture
    1,650 Moderator on at

    Assuming you  have a SharePoint List, you can use formula as below:

    Min: First(Sort('YourSharePointList',Created,SortOrder.Ascending)).Created
    
    Max: First(Sort('YourSharePointList',Created,SortOrder.Descending)).Created

     

    I didn't suggest to use Min() function because it is not delegable in SharePoint.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • joel914823 Profile Picture
    557 on at

    @happyume Thanks for your help!   I was trying to do a datediff between the two variables, but running into an error - would you happen to know why (I put the datediff in the Max), see screen shot, any help is appreciated.

     

    Screenshot 2024-07-08 114843.png

  • Mitanshu Profile Picture
    1,650 Moderator on at

    Earliest_CreatedDate and Latest_CreatedDate_1 are Controls and not a Date. You need to obtain value of the Control and then convert into Date.

     

    Try:

     

    DateValue(Earliest_CreatedDate.Text)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard