cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PedroViviani
Level: Powered On

Sort a gallery based on one of the item results

So i totally lost on this one, I have a table similar to this one:
Fruit         Color     Amout
Apple      Green         2

Apple        Red          5
Banana    Green       10
Banana    Yellow       15

And I want a GALLERY that display the following results:

__________________
Banana        25

__________________
Apple           7
__________________

 

I tried using Distinc on the Item of the gallery so i get only one fruit, and crete a formula that sum all the fruits, but wasnt able to SORT it the right way (I want the biggest numbers on top, descending). I think i need to create a new table istead of using the old one. Any help? Am I clear enought with the problem?

(This is a simple example and the original problem consists of more "fruits" ands "colors")

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Sort a gallery based on one of the item results

Hi @PedroViviani 

 

 

SortByColumns(AddColumns(GroupBy(colDataBase,"Fruit","Name"),"Count",Sum(Name,Amount)),"Count",Descending)

 

colDataBase - anme of your data source - Table or collection

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Sort a gallery based on one of the item results

Hi @PedroViviani 

 

 

SortByColumns(AddColumns(GroupBy(colDataBase,"Fruit","Name"),"Count",Sum(Name,Amount)),"Count",Descending)

 

colDataBase - anme of your data source - Table or collection

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

PedroViviani
Level: Powered On

Re: Sort a gallery based on one of the item results

Thank you!
It worked as I wanted, I just added a filter on the source that i did not specified in the topic.
Thanks again @RezaDorrani !!!

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,872)