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 / Help with a formula to...
Power Apps
Answered

Help with a formula to sum collect values

(0) ShareShare
ReportReport
Posted on by 52

Hello,

 

I create a collection from excel Datasource with the formula: ClearCollect(GroupbyConcept; GroupBy(Tabla1; "Concepto"; "total")) 

 

But I don't know how to  Sum the prices by concept, por example:

 

Autopista: 64 €

Dieta: 117,54

 

Excel DataSource:

Excel

 

Collection 

Collection 2

 

 

Categories:
I have the same question (0)
  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi @resteve, please try this. (Please note that you probably have to use ; instead of ,)

     

    AddColumns(GroupByConcept, "SumByConcept", Sum(total, Precio))

    You could even do this

    ClearCollect(GroupbyConcept, AddColumns(GroupBy(Tabla1, "Concepto", "total"), "SumByConcept", Sum(total, Precio)))

    Please let me know how you get on.

  • resteve Profile Picture
    52 on at

    Perfect, it works!

    Then I need two formulas and two different buttons?

    ClearCollect(GroupbyConcept; GroupBy(Tabla1; "Concepto"; "total"))

    ClearCollect(GroupbyConcept;AddColumns(GroupBy(Tabla1;"Concepto";"total");"SumByConcept"; Sum(total; Precio)))

     

    I add a chart but the legend is the same than chart, Can I change to concepto?. Thank you!

     

    Chart

    chart 2

     

    chart 3

  • resteve Profile Picture
    52 on at

    Sorry, first paragraph or question of the previous post is already solved, I can have several actions in one formula with PowerApps chaining operator: ;; (double semi-colon) but only it's necessary the second action. Thank you!

  • Meneghino Profile Picture
    6,949 on at

    Hi @resteve

    Yes, try changing the labels or series to Concepto, see below...

    __.JPG

  • resteve Profile Picture
    52 on at

    Hi,

    I attach some screenshots because I've changed the labels and series but it doesn't work.

     

    label

     

    label2

     

    label3

  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi @resteve

    I have found the solution.  The key is in your third screenshot.  You need to change the Items property from PieChart1.SeriesLabels to GroupByConcept and then the Value to Concepto.

    Please let me know how you get on.

     

    __.JPG

  • resteve Profile Picture
    52 on at

    Done Smiley Very Happy. Thank you so much!. This community is very helpful!

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard