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

Help with Max date

(0) ShareShare
ReportReport
Posted on by 25

 

Hello all, 

I'm a new PowerApps user, I'm tasked with building a proof of concept app for my organization.

 

I've built everything thus far buy watch YouTube videos and Google searches.  My current issue is how to return the Max date or last date for each store.

 

background

I have a sharePoint list with a Store id called SCID and a date field with the visit date.

I want to create a 2 column collection with the SCID and the last vist date for the SCID.

 . 

 

I used the solution posted here and I just replaced fields with my info: https://powerusers.microsoft.com/t5/General-Discussion/Max-date/td-p/299657

 

PowerApps states invalid arguments received 2 expected 3 or more

 

ClearCollect(colLastVisit, 
 AddColumns(
 GroupBy(Store_Visit,Store_Visit.Store_SCID),
 "LastVisitDate", Max(Visit_Date))
 )
)

What did I do wrong?

 

Thanks in advance

 

 

 

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @Sjj9166 

     

    GroupBy will return a collection with only 1 column called Result

     

    You can just try adding a temp collection and store 

     GroupBy(Store_Visit,Store_Visit.Store_SCID)

    and check 

     

     

    Hence when you try

     AddColumns(
     GroupBy(Store_Visit,Store_Visit.Store_SCID),
     "LastVisitDate", Max(Visit_Date))
     )

    it will fail since Visit_Date is not a part of that collection

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Sjj9166 ,

    Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below:

     

    ClearCollect(
    colLastVisit,
    AddColumns(
    GroupBy( Store_Visit,
    Store_SCID,
    "GroupData" ),
    "LastVisitDate",
    First(Sort(GroupData, Visit_Date, Descending)).Visit_Date
    )
    )

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

     

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

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard