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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to move to next va...
Power Apps
Answered

How to move to next value?

(0) ShareShare
ReportReport
Posted on by 40

Good day!

 

I am planning to create a monitoring app wherein users can see the current quantity of the entry and subtract every time they do an export.

Here's how my table roughly looks like connected in an Excel sheet:

IDTitleQty
1A25
2B30

 

Let's say you want to get 10. It should get 10 from the first row and update the remaining Qty as 15. But Let's say you want to get 30, it must first get the 25 from the first row and get 5 from the next. And ideas/formulas on how to do it?

 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @LTomas ,

     

    I made a sample for you:

     

    Create a table in Excel.

    vxiaochenmsft_0-1668499382030.png

     

     

    In PowerApps, ‘Data Table’ to connect to Excel table for view data, ‘Text input’ to enter numbers, ‘Button’ to submit data and set as follows.

    ClearCollect(TestA,ForAll(Test,If(Sum(FirstN(Test,Value(ThisRecord.ID)),Qty)<Value(TextInput1.Text),{ID:ID,Title:Title,Qty:0})));
    UpdateIf(Test,ID=LookUp(Test,!(ID exactin TestA.ID)).ID,{Qty:Sum(FirstN(Test,Value(ThisRecord.ID)),Qty)-Value(TextInput1.Text)});
    UpdateIf(Test,ID exactin TestA.ID,{Qty:0})

    vxiaochenmsft_1-1668499382041.png

     

     

    Enter the number and submit, the data is updated.

    vxiaochenmsft_2-1668499382043.png

    Best Regards,

    Wearsky

  • LTomas Profile Picture
    40 on at

    Thank you very much! Will apply this logic.

  • LTomas Profile Picture
    40 on at

    Hi @v-xiaochen-msft!

     

    Just tried your method. having problems in converting it to be suitable in my use case.

    in the said table, the records in the table is using sharepoint list. And one of the columns is Commodity (textColumn). The items section is Filter('Import-Polymers', Commodity = dropdown_rawmaterial.Selected.Value).

     

    So based on your code, I just have to replace "Test". But for some reason, I have been encountering errors with Power Apps not actually explaining said error. Can you provide an alternative version of the said code?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard