cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Sum based on another field in the same SharePoint List

Dear @mdevaney and Others, 

 

I have a SalesDeatils_1 list under the I have a look up for Invoice number from another list called SalesTable. Following is how data looks like in the SalesDetails_1

 

ID---------Invoice number---------qty------price-----Total Value

1-----------01-----------------------10--------10-------100

2-----------01-----------------------05--------20-------100

3-----------02----------------------100-------10-------1000

 

I want to get the Total value (Sum) related to Invoice number in a new screen. E.g Invoice Number 01 Total 200/-

In that new screen I have a dropdown again based on the SalesDeatils_1 where Invoice number default selected. Screen Shot attached, 

 

Capture.PNG

 

Osmand. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JesperHuang
Level: Powered On

Re: Sum based on another field in the same SharePoint List

Hi @OsmandFernando ,

 

I have made an example below, in your case just replace source to your sharepoint list.

 

First i create collection named SalesDetails, and set new variable named _SelectInvoiceNum.

ClearCollect(SalesDetails,
{ID:1,InvoiceNumber:01,qty:10,price:10,TotalValue:100},
{ID:2,InvoiceNumber:01,qty:5,price:20,TotalValue:100},
{ID:3,InvoiceNumber:02,qty:100,price:10,TotalValue:1000}
);
Set(_SelectInvoiceNum,0)

When user click on gallery, Reset the _SelectInvoiceNum variable to selected item invoice number.

Navigate(ScreenDetail,Transition.None);
Set(_SelectInvoiceNum,ThisItem.InvoiceNumber);

Setsource.pngOnselectevent.png

 

In another screen, simply use SUM function can satify what u need.

Sum(Filter(SalesDetails,InvoiceNumber=_SelectInvoiceNum),TotalValue)

detailview.png

 

hope this help! 

View solution in original post

2 REPLIES 2
JesperHuang
Level: Powered On

Re: Sum based on another field in the same SharePoint List

Hi @OsmandFernando ,

 

I have made an example below, in your case just replace source to your sharepoint list.

 

First i create collection named SalesDetails, and set new variable named _SelectInvoiceNum.

ClearCollect(SalesDetails,
{ID:1,InvoiceNumber:01,qty:10,price:10,TotalValue:100},
{ID:2,InvoiceNumber:01,qty:5,price:20,TotalValue:100},
{ID:3,InvoiceNumber:02,qty:100,price:10,TotalValue:1000}
);
Set(_SelectInvoiceNum,0)

When user click on gallery, Reset the _SelectInvoiceNum variable to selected item invoice number.

Navigate(ScreenDetail,Transition.None);
Set(_SelectInvoiceNum,ThisItem.InvoiceNumber);

Setsource.pngOnselectevent.png

 

In another screen, simply use SUM function can satify what u need.

Sum(Filter(SalesDetails,InvoiceNumber=_SelectInvoiceNum),TotalValue)

detailview.png

 

hope this help! 

View solution in original post

Re: Sum based on another field in the same SharePoint List

Thank you @JesperHuang  I just wanted that last screenshot to see how to set the formula. This is really helpful. Thank you so much. 

 

Osmand 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,000)