Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

PowerApps Summing on If Else Depending on a Choice Field

Hi all,


I am currently trying to Sum transactions where they are positive on a Sell and Negative on a Buy.

My 'transaction type' choice field is a Buy/Sell choice.

My SD date projects out how many days away the transactions are.


For this first column in my Clearcollect I have tried using an IF statement depending on whether my transaction is a Buy/Sell.


If the transaction is a Sell I am trying to Sum that trade amount positively, if its a Buy I am trying to Sum that trade amount as a negative number in order to show the net difference, hence the Else is 'trade amount' * -1 


Currently I have tried using below below for the condition of the If statement - but none work:

[@'transaction type'].Value = "Sell"

'transaction type'. Value = "Sell"

'transaction type'= "Sell"

'transaction type'= 'transaction type'. Sell


Below is the current state of my code and the output on my App








Many thanks,


Super User
Super User

Hi @cnr ,


You can try below code if it works ? 


'transaction type'.Value = "Buy"

'transaction type'.Value = "Sell"




Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (3,169)