Im trying to create an If Statement so that if the choice field is a Sell, I Sum the amount and if its a Buy I add Subtract the amount by multiplying it by -1.
My error is saying incompatible types for comparison. But it will not work if I set it to .Value either posted below
Thanks for responding, I tried that along with the below but neither work.
I get the following errors:
Unfortunately that doesnt work
In the last one I am sure it should be only "Sell"
Do you have that on a gallery or soemthing?
ThisItem.'Transaction Type'. Value = "Sell"
We just need to identify which item we want to compare.
If you need to comapre all, use a ForAll()
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Check my LinkedIn!
Check my User Group (pt-PT)!
This is most likely a disambiguation issue that relates to referencing 'Transaction Type' inside a call a call to AddColumns,
I'd try the following syntax to see if that works...
If( 'Transaction Type' = [@'Transaction Type'].Sell
Thanks for the response,
I'm very confused by this because I used a similar method on a different screen shown here which did work:
I tried that but didnt work, what do you mean by a call a call to AddColumns?
@Hi @Nogueira1306 ,
Yeah I tried that - Says it cannot compare a table and text
I dont understand because I created a similar if statement with the same kind of logic on a choice field and it did work:
I created a Clearcollect in a button where I sum up all my values and then ThisItem.NetAmount.
But I need the Amounts to Sum positively if its a Sell and negatively if its a Buy
Can you confirm that 'Transaction Type' is a single select 'Choice' column, rather than a multi select 'Choices' column, as this could account for the incompatible type error?
To diagnose this further, I would try renaming the Transaction Type field to something like TransType, to remove any ambiguity in naming. If you try the formula below, does that result in the same error?
AddColumns( RenameColumns(UpcomingSettlementFundsGroupingFunds, "Transaction Type", "TransType"), "Netting TPlusOne", If( TransType = [@'Transaction Type'].Sell
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.