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
Super User
Super User

@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
Super User
Super User

@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 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.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,236)