cancel
Showing results for
Did you mean:
Level: Powered On

## Help with a formula to sum collect values

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:

2 ACCEPTED SOLUTIONS

Accepted Solutions
Level 10

## Re: Help with a formula to sum collect values

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.

Level 10

## Re: Help with a formula to sum collect values

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.

7 REPLIES 7
Level 10

## Re: Help with a formula to sum collect values

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.

Level: Powered On

## Re: Help with a formula to sum collect values

Perfect, it works!

Then I need two formulas and two different buttons?

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

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

Level: Powered On

## Re: Help with a formula to sum collect values

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!

Level 10

## Re: Help with a formula to sum collect values

Hi @resteve

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

Level: Powered On

## Re: Help with a formula to sum collect values

Hi,

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

Level 10

## Re: Help with a formula to sum collect values

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.

Level: Powered On

## Re: Help with a formula to sum collect values

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

Announcements

#### Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

#### Power Platform World Tour

Find out where you can attend!

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

#### Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,862)