cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TKEnes
Helper I
Helper I

Use previous calculation in a new calculation

How can I use the solution of a statement in the next calculation?

 

AddColumns(
    TestList,
    "test solved",
    If(
        ThisRecord.CW = 1, Solved + 2,
        ThisRecord.CW = 2, (Solved+[Previous Calculation]*6)/7
    )
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
rsaikrishna
Community Champion
Community Champion

@TKEnes 

 

Can you provide details about your previous calculation? Did you define "previous calculation" in the same formula bar or in any other location in the app?

 

If you have a formula for "Previous Calculation" somewhere in the same screen, then you can use UpdateContext({varPrevCalculation: <define your logic>})

 

If you have a formula for "Previous Calculation" somewhere in different screen, then you can use

Set(varPrevCalculation, <define your logic>)

 

If you have a formula in the same formula bar where you have AddColumns function, then you can use With() function. Refer the documentation for With() : https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-with 

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

1 REPLY 1
rsaikrishna
Community Champion
Community Champion

@TKEnes 

 

Can you provide details about your previous calculation? Did you define "previous calculation" in the same formula bar or in any other location in the app?

 

If you have a formula for "Previous Calculation" somewhere in the same screen, then you can use UpdateContext({varPrevCalculation: <define your logic>})

 

If you have a formula for "Previous Calculation" somewhere in different screen, then you can use

Set(varPrevCalculation, <define your logic>)

 

If you have a formula in the same formula bar where you have AddColumns function, then you can use With() function. Refer the documentation for With() : https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-with 

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,001)