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 Apps
Answered

Date Formulas

(0) ShareShare
ReportReport
Posted on by 206

HI,

 

Today is 4/11/2022...

Have a question about some code I have.  Why does line 1 produce records from last Friday, 4/1/2022, 

and line 2 obviously produces today records as expected?

 

LINE 1 :  //Filter(dvDailyTeamss, WorkDate=First(Sort(Distinct(dvDailyTeamss,WorkDate),Result,Descending)).Result)
Line 2:   //Filter(dvDailyTeamss, WorkDate=Today())

 

I would have thought if I am sorting Line 1 (descending) , and using the FIRST function, it would pick up the latest date, which is today, 4/11/2022?  

 

See attached PNG file for dataverse table columns being referenced.

 

Thanks!

 

 

 

dateQuestion.png
Categories:
I have the same question (0)
  • MrAutomate Profile Picture
    206 on at

    apologies for the typo:

    Why does line 1 produce records from last Friday, 4/8/2022, 

  • Verified answer
    timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    @MrAutomate 

    Most likely, this is because Distinct isn't delegable, so line 1 picks up the latest date based on the first batch of 500 records (or whatever you've set the "data row limit" to be in the settings)

    I imagine you can remove the call to Distinct, and it should logically return the intended results.

  • MrAutomate Profile Picture
    206 on at

    Thanks, Tim, that was it. 

     

    I changed from 500 to 2000 and todays rows showed up.  Changing from the SP list to the dv Table today, I suspected it was something not so obvious.  I may throw a view on that dv table to get around the delegation issue.  Thanks again

  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    You're welcome @MrAutomate - glad that solved the problem!

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 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard