cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
User237
Helper III
Helper III

Sum of lines amount(s) need to show in header

Hi Experts,

I am new to PowerApps, I have connected SQL Server to my PowerApps.

My requirement is to get the sum of lines amounts and need to show in header.

For suppose I have one purchase order(header) for that purchase order 3 lines are present, each line having 100, 100 and 100 line amounts respectively.

In the powerapp i have added the header as a datasource, after that it automatically created a browseScreen with layout( tittle, subtittle and body).

Now in the body field, I need to show the sum of all lines amount.

Please can anyone help me to achieve this?

Thanks in Advance,

with regards,

User237.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @User237 ,

Could you tell me the relationship between Purchtable and PurchLine?

How do you get the data of PurchLine based on the selected item in Purchtable?

Are Purchtable and PurchLine two sql tables in your issue?

If you could show me the formula of the gallery and the data table, it will be better.

 

I assume that Purchtable and PurchLine are two sql tables.

Purchtable and PurchLine both have a field named PurchID and you filter PurchLine based on this field.

If so , you could set the label's Text inside the gallery for Purchtable like this:

Sum(
     Filter(PurchLine,PurchID=ThisItem.PurchID),
     LineAmount
   )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
eka24
Super User
Super User

Can you show a screenshot

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

hi @eka24 ,

Thanks for your reply,

screenshot of which one? powerApp or header, line.

with regards,

User237.

eka24
Super User
Super User

A screenshot of the line. Is the header also in a Gallery or just a Textbox

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-yutliu-msft
Community Support
Community Support

Hi @User237 ,

Could you tell me:
1)the fields name in your data source? the fields data type?

2)the screenshoot of your app?

3)the settings of the controls in your app?

Actually, based on your description, I do not quite understand the feather that you want.

If you could describe with pic, it will be better to understand.

If you want to get the sum of one field, you could use this formula:

Sum(sqltablename,fieldname)
//this field should be number type

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @eka24 , @v-yutliu-msft 

Thanks for your replies,

Below screenshot related to the header ie, purchase order header table.

PurchtablePurchtable

In the specified field, i need the sum of line amounts.

In the header there is no field called amount.

And this is screen1 for my powerApp, after clicking on forward arrow symbol it will navigate to lines screen.

below screenshot regarding the lines details,

purchLinepurchLine

these are the line details for the particular purchase order.

Now, the sum of these two amounts i need to show in the header.

the header table names is PurchTable and the line table name is PurchLine.

In the PurchLine Table the field name is LineAmount and datatype is Real.

Thanks,

with regards,

User237. 

Hi @User237 ,

Could you tell me the relationship between Purchtable and PurchLine?

How do you get the data of PurchLine based on the selected item in Purchtable?

Are Purchtable and PurchLine two sql tables in your issue?

If you could show me the formula of the gallery and the data table, it will be better.

 

I assume that Purchtable and PurchLine are two sql tables.

Purchtable and PurchLine both have a field named PurchID and you filter PurchLine based on this field.

If so , you could set the label's Text inside the gallery for Purchtable like this:

Sum(
     Filter(PurchLine,PurchID=ThisItem.PurchID),
     LineAmount
   )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft ,

Thanks for your reply,

It helped me a lot to solve.

kind regards,

User237.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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