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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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,658 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,658 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard