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 / Create a sum if toggle...
Power Apps
Unanswered

Create a sum if toggle is turned on

(0) ShareShare
ReportReport
Posted on by 2

Hey guys,

 

fairly new to powerapps and I've been trying to create a text box containing the total value of all selected items. 

There are a number of toggles and based on whether the toggle is on or off I would like to add the amount in the textbox next to it to a total that is located in another label. 

My idea was to have an invisible label that gets a value only if the toggle is on (which would make it easier to add the sum of those boxes afterwards) but that does not work either
I tried to do this with the following formula. 
If(DataCardValue27.Value=true;'289';'0') 

Pretty sure I'm probably overcomplicating this...

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    You could put the textboxes in a Gallery (assuming they are dynamic)

    Then you can calculate the sum  using the formula below:

     

    Sum(

    Filter(

    (Gallery.AllItems.'Your field you want to add', 'Your field you want to add'),

    'Your toggle field' = true)

    )

  • Nikeo2808 Profile Picture
    2 on at

    I don't think that works all of the text label seem to be in different datacards which does not allow me to select them and group them together. 
    Also the value in the textbox is static and thus will always be the same 

     

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Isn't this what you want?

    Animation3.gif

     

    Used a gallery, you could just initiate with as many records as you like.

    Items property of the Gallery in my case is [{IntValue:0},{IntValue:0},{IntValue:0}]

    Gallery has two controls TextInput1 and ToggleButton

    The formula in the Total label is:

    "Total: " & Sum(
    Filter(
    Gallery1.AllItems,
    ToggleButton.Value = true
    ).TextInput1,
    TextInput1.Text
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard