web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get Item Totals From L...
Power Apps
Unanswered

Get Item Totals From ListBox selection

(0) ShareShare
ReportReport
Posted on by

Hello all!

 

I'm trying to build a PowerApp that will be used for re-ordering items from an inventory, but I'm running into an issue where I can't get the current item amount to show based on a selection from a listbox. Can someone help me out with the formula?

 

Applications_0-1658180125537.png

In the current quantity I want it to show the value I have in the columns "Quantity in Reorder" and "Quantity Overall" in the FFD Inventory SP list:

Applications_1-1658180168022.png

 

So it needs to filter that data source to the listbox selection and provide the sum of the values in those two columns. Any thoughts? 

 

Currently I have

Sum(Filter('FFD Inventory', Sum('Quantity in Reorder' && 'Quantity Overall'), ListBox1.SelectedItemsText.Value))

but it isn't working. 

 

Many thanks! 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at
    Re: Get Item Totals From ListBox selection

    @Applications 

    If your ListBox is set to the datasource items, then you simply need the following:

    ListBox1.Selected.'Quantity in Reorder' + ListBox1.Selected.'Quantity Overall')

     

    Avoid using the SelectedText property as it is deprecated.

     

    I hope this is helpful for you.

  • Applications Profile Picture
    on at
    Re: Get Item Totals From ListBox selection

    My List box is distinct, here's the formula for the listbox:

    Sort(Distinct('FFD Inventory', Description), Ascending)

    The reason it's not datasourced is because if I use 'FFD Inventory'.Description' in Items it shows as blank:

    Applications_0-1658185219130.png

     

    So since it's not a direct datasource, how would your recommendation look via code?

    I tried this and it didnt work:

    Sum(Filter('FFD Inventory', Sum(ListBox1.Selected.'Quantity in Reorder' + ListBox1.Selected.'Quantity Overall')))

     

    Thank you!

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at
    Re: Get Item Totals From ListBox selection

    @Applications 

    Yes, that formula will not work.

     

    So my question though is this - if you are doing a distinct (meaning there could be more than one record with the same description), then when you do a sum, which record are you trying to sum??  Or are you trying to sum all of them?

     

    If you are trying to sum all of them, then this Formula should give you what you need:

    Sum(
     Filter('FFD Inventory', Description=ListBox1.Selected.Result), 
     'Quantity in Reorder' + 'Quantity Overall'
    )
  • Applications Profile Picture
    on at
    Re: Get Item Totals From ListBox selection

    @Randy 

     

    Only reason I use distinct is because it showed the results - is there another function I can use rather than Distinct?

     

    Also, just trying to sum the columns "Quantity in Stock" and "Quantity in Reorder" from the SharePoint list.

     

    Hope this clarifies - thanks!

  • Applications Profile Picture
    on at
    Re: Get Item Totals From ListBox selection

    Disregard, I was able to get the ListBox to be a direct datasource and then the formula you linked earlier worked. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard