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 / Group By To get Highes...
Power Apps
Answered

Group By To get Highest Date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello People, 

I'm trying to group the columns Brand Name and Inspection date to get the highest date by brand. But I'm getting the error. Could anyone please review the code. It will be really great.

Input:- 

Mercedes14/4/2000
Mercedes1/12/2006
Mercedes2/12/2020
BMW1/12/2018
BMW25/5/2018
BMW25/5/2019
Audi25/5/2018
Audi1/12/2019
Audi1/12/2020

 

Output:-

Mercedes2/12/2020
BMW25/5/2019
Audi1/12/2020

 

 

 

ClearCollect(myBrand,DropColumns(AddColumns(GroupBy(myBrandItems,"Vehicle_Brand","Date for Inspection"),"Brand Date",First(Sort(Brand_Details, Inspection_Date,Descending)).Inspection_Date)),"Date for Inspection")

 

 

 

Thanks 🙂

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @Tiksha ,

    GroupBy() needs a "grouped" column - try the below

    ClearCollect(
     myBrand,
     AddColumns(
     GroupBy(
     Sort(
     myBrandItems,
     Inspection_Date,
     Descending
     ),			 
     "Vehicle_Brand",
     "Data"
     ),
     "Brand Date",
     First(Data).Inspection_Date
     )
    )

     

    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 the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard