cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Premium
Frequent Visitor

Sum of a calculated/lookup column

Dear Community

 

I need your help.. 🙂

Problem
I want to display a total of all entries in a calculated column (Amount)

Setup:

SP List: Report:

TitleHoursPrice
TextTextText
Hans25
Max210

 

SP List: Customers

TitlePrice
TextText
Hans5
Max10

Powerapp: Gallary1:

TitleHoursPriceAmount
Textreport.hoursLookup(Customers, ThisItem.Title = Title).PriceHours * Lookup(Customers, ThisItem.Title = Title).Price
Hans2510
Max210

20

 

Now i want a Text Label who SUM all Items in the Gallary Row "Amount" (10+20 = 30)

I cant do SUM(Gallary1.Allitems,Amount) because the Amount row has no Name ist calculatet (Hours * Price)

 

 

Thanks !

Levin

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Super User
Super User

I think I have an idea of what you are asking, and that this example should help you figure it out

 

TheRobRush_0-1655247019040.png

In the above gallery I have the items from TestColl which is a test collection I made with this as its items

Collect(TestColl,{Value1:1,Value2:10},{Value1:4,Value2:7},{Value1:3,Value2:20})

 

the third label in the gallery is just the two items multipled.

 

In the label off to the right of the screenshot above you have the sum of all the multiplications in the gallery, achieved like so

Sum(
    ForAll(
        Gallery5.AllItems,
        Value(ThisRecord.Title7_1.Text)
          ),

    Value)

where gakllery5 is my gallery, and Title7_1 is the control where the multiplication takes place

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

3 REPLIES 3
TheRobRush
Super User
Super User

I think I have an idea of what you are asking, and that this example should help you figure it out

 

TheRobRush_0-1655247019040.png

In the above gallery I have the items from TestColl which is a test collection I made with this as its items

Collect(TestColl,{Value1:1,Value2:10},{Value1:4,Value2:7},{Value1:3,Value2:20})

 

the third label in the gallery is just the two items multipled.

 

In the label off to the right of the screenshot above you have the sum of all the multiplications in the gallery, achieved like so

Sum(
    ForAll(
        Gallery5.AllItems,
        Value(ThisRecord.Title7_1.Text)
          ),

    Value)

where gakllery5 is my gallery, and Title7_1 is the control where the multiplication takes place

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Sunil-Narnaware
Super User
Super User

@Premium Gallery' main function is to display data from the source.. now in your case the Amount that you are calculating is on the fly..  what's the Gallery' Items Property.?

Thanks @TheRobRush this is exactly what I needed.It's really extreme how quickly help is given here, and probably voluntarily... That's very nice to see

 

greetings from Switzerland

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,760)