cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
katunari
New Member

Sort gallery based on the product of values in 2 columns

Hey guys,

 

I have a gallery with multiple columns including 'distance' and 'price/km'.

I now want to sort the gallery based on the product of the 2 columns ('distance'*'price/km') - (it is not possible to write the result in a new column).

 

Can anybody help?

 

Thanks!

1 REPLY 1
mdevaney
Super User
Super User

@katunari 

Put this code in the Items property of your Gallery.  It will sort the result by greatest-to-least.

Sort(
    AddColumn(
        your_datasource_name,
        "TotalPrice",'distance'*'price/km'
    ),
    TotalPrice, Descending
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,842)