web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps VAT checkbox...
Power Apps
Unanswered

Powerapps VAT checkbox calculation not working

(1) ShareShare
ReportReport
Posted on by 70

I added this calculation into my app, but for some reason it only ever pulls through the below numbers or doesn't do the calculation.

 

OnCheck: 

 

Set(
totalIncVAT,
Value(Textbox_Expensetotal.Value)
);
Set(
VAT,
totalIncVAT - (totalIncVAT/1.2)
);
Set(
totalExclVAT,
totalIncVAT - VAT
);

OnUncheck:

 

Set(totalIncVAT, Value(Textbox_Expensetotal.Value));
Set(VAT, (0));
Set(totalExclVAT, (0));

When I uncheck it comes up as blank - I want it to come up with £0.00

 

This is for the submit button.

UpdateContext(
{
varID:
Patch(
'All data #3',
Defaults('All data #3'),
{
'Amount incl. VAT': totalIncVAT,
'Amount Excl. VAT': totalExclVAT,
'VAT (20%)': VAT
} ).ID

 

Cseni_0-1714388838485.png

 

 

thank you

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    It looks like when you leave it unchecked its not setting the variables, this is likely because the unchecked function hasn't run yet because that is only run when the value was previously Checked.

     

    I would instead remove the functions from your OnCheck/Check and instead have them on the patch:

    UpdateContext(
    {
     varID:
     Patch(
     'All data #3',
     Defaults('All data #3'),
     {
     'Amount incl. VAT': Value(Textbox_Expensetotal.Value),
     'Amount Excl. VAT': Value(Textbox_Expensetotal.Value) - (Value(Textbox_Expensetotal.Value) * 20%),
     'VAT (20%)': Value(Textbox_Expensetotal.Value) * 20% 
     }
     ).ID
    }
    )

     

    Could you please give that a try?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard