cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cnr
Advocate II
Advocate II

Creating a Dynamic Principle and Interest Table

Hi all,

 

I'm attempting to create a table in PowerApps where if I create a Decrease or Increase amount the following Principle amount will update and the interest amount will also update.

 

Would anyone have any ideas on how to go about this ?

 

cnr_1-1651230008227.png

Many thanks,

Conor

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Silvester
Skilled Sharer
Skilled Sharer

Sadly Row no 16 is not showing on the image but let me rewrite the formula for you.

Text(
    If(
        ThisItem.ItemDay >= PaydwnDate.SelectedDate And Not(IsBlank(Paydown)),
        ThisItem.Principle - Paydown,
        If(
        ThisItem.ItemDay >= PaydwnDate2.SelectedDate And Not(IsBlank(Paydown2)), 
        ThisItem.Principle - Paydown - Paydown2,
        ThisItem.Principle
        )
    ),
    "#,###,###"
)


If you find this post interesting kindly give a Like or you can accept it as a solution to help others find it.

View solution in original post

6 REPLIES 6
Silvester
Skilled Sharer
Skilled Sharer

which datasource are you planning on using?

Will a new record be created anytime, the calculation is being performed?
Or are you just a updating the record each and every time? 

kylzbaba
Resolver I
Resolver I

Patch(YourDatasource, SelectedRecord, {PrincipalAmount: PrincipalAmount - Value(InputValue)}) 

 

Patch(YourDatasource, SelectedRecord, {PrincipalAmount: PrincipalAmount + Value(InputValue)}) 

 

If you need to maintain the old values you can create a database to act as log that collects the values and the datetime they were changed.

 

 

If you need the increment and decrement to occur automatically, you can set the above formula on the onchange property of the TextInput control. 

 

 

So basically you have one datasource that has the principle amounts and will get changed when a textinput receives new values in Power Apps. If you like as I mentioned before you can create a different database to collect a log of changes.

cnr
Advocate II
Advocate II

Hi @Silvester , @kylzbaba 

 

Thanks for your reply. I went back and redid this. I think I was making this more complicated then it needed to be, I'm getting the desired output with the below using a ForAll()

 

cnr_0-1651727189222.png

 

Im wondering why though my If statement isnt fully working? - You can see on row No. 3 above that the amount changes by 50000 but not on row No.16. If my if statement off ?

Text(
    If(
        ThisItem.ItemDay >= PaydwnDate.SelectedDate And Not(IsBlank(Paydown)),
        ThisItem.Principle - Paydown,
        ThisItem.ItemDay >= PaydwnDate2.SelectedDate And Not(IsBlank(Paydown2)), 
        ThisItem.Principle - Paydown - Paydown2,
        ThisItem.Principle
    ),
    "#,###,###"
)

 

Silvester
Skilled Sharer
Skilled Sharer

Sadly Row no 16 is not showing on the image but let me rewrite the formula for you.

Text(
    If(
        ThisItem.ItemDay >= PaydwnDate.SelectedDate And Not(IsBlank(Paydown)),
        ThisItem.Principle - Paydown,
        If(
        ThisItem.ItemDay >= PaydwnDate2.SelectedDate And Not(IsBlank(Paydown2)), 
        ThisItem.Principle - Paydown - Paydown2,
        ThisItem.Principle
        )
    ),
    "#,###,###"
)


If you find this post interesting kindly give a Like or you can accept it as a solution to help others find it.

Silvester
Skilled Sharer
Skilled Sharer

Hello @cnr has it worked? 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,654)