Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

variable to set latest date and earliest date

(1) ShareShare
ReportReport
Posted on by 551

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?  

  • Mitanshu Profile Picture
    1,614 Super User 2025 Season 1 on at
    Re: variable to set latest date and earliest date

    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.

  • joel914823 Profile Picture
    551 on at
    Re: variable to set latest date and earliest date

    @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

  • Verified answer
    Mitanshu Profile Picture
    1,614 Super User 2025 Season 1 on at
    Re: variable to set latest date and earliest date

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard