cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GoGorilla
Helper III
Helper III

Sum a SharePoint field in a collection keeps changing value when choosing an item

Hi, All.

 

I have a label that sums and filters by phase all the TCV fields from a collection based on a SharePoint list, but when I open any item in the Gallery, the number changes.  I need a number that only changes if a new item is added or the phase changes not when opening an item.  See my formula below:

 

 

Text(
    Sum(
        Filter(
            collectTCV,
            ( Not("Lost" in BDPhaseDataCardValue.SelectedItems)) &&  (Not("Abandon/No Bid Cancelled" in BDPhaseDataCardValue.SelectedItems))
        ),
        Value(TCVDataCardValue.Text)
    ),
    "[$-en-US]#,##0.00"
)

 

 

Any help will be much appreciated.

 

Misty 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@GoGorilla 

Your formula is out of context.  You are referencing a DataCardValue which I am guessing is somehow tied to the selected item of your Gallery.

Can you explain more about that datacardvalue and where it is?  I would imagine you really want to sum the values that are in the collection, not in a datacardvalue control.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@GoGorilla 

Your formula is out of context.  You are referencing a DataCardValue which I am guessing is somehow tied to the selected item of your Gallery.

Can you explain more about that datacardvalue and where it is?  I would imagine you really want to sum the values that are in the collection, not in a datacardvalue control.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes  Aha, you are correct.  I want to sum the values in the collection (a SharePoint list) based on the filter.  The datacardvalue is on a form in another screen.

@GoGorilla 

That should solve your issue once you have the correct collection field there.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes Sorry, I meant to post my new formula which works:

"$" & Text(
    Sum(
        Filter(
            collectTCV,
            ( Not("Lost" in BDPhaseDataCardValue.SelectedItems)) &&  (Not("Abandon/No Bid Cancelled" in BDPhaseDataCardValue.SelectedItems))
        ),
        Value('Total Contract Value')
    ),
    "[$-en-US]#,##0.00"
)

 Thank you for you help! 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,126)