Skip to content

Power Apps

Group By And Find The MINIMUM Values

Group By And Find The MINIMUM Values Input collection: myTravelExpenses 8 Date Item Value 1/1/2020 Hotel 1050 1/1/2020 Food 30 1/2/2020 Food 75 1/3/2020 Hote...

Matthew Devaney
Published
Reading time
1 min read

Before you start

Is this guide for you?

Best entry point
Power Apps
Time investment
1 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/powerapps-collections-cookbook/group-by-and-find-the-maximum-values/. Author: Matthew Devaney.

Group By And Find The MINIMUM Values Input collection: myTravelExpenses 8 Date Item Value 1/1/2020 Hotel 1050 1/1/2020 Food 30 1/2/2020 Food 75 1/3/2020 Hotel 1300 1/3/2020 Food 50 1/4/2020 Flight 800 Output collection: mySolution 8 Item Max Value Hotel 1050 Food 30 Flight 800 Solution code: //Create a collection

ClearCollect(myTravelExpenses8, { Date : Date ( 2020 , 1 , 1 ), Item : "Hotel" , Value : 1050 }, { Date : Date ( 2020 , 1 , 1 ), Item : "Food" , Value : 30 }, { Date : Date ( 2020 , 1 , 2 ), Item : "Food" , Value : 75 }, { Date : Date ( 2020 , 1 , 3 ), Item : "Hotel" , Value : 1300 }, { Date : Date ( 2020 , 1 , 3 ), Item : "Food" , Value : 50 }, { Date : Date ( 2020 , 1 , 4 ), Item : "Flight" , Value : 800 } ); //Group by and minimum column code

ClearCollect( mySolution8, DropColumns( AddColumns( GroupBy(myTravelExpenses8, "Item" , "GroupedItems" ), "Min Value" ,Min(GroupedItems,Value) ), "GroupedItems" ) ); Code language: JavaScript ( javascript )

Share this

Tagged

Power Apps

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →