cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Super User
Super User

EDITING SUMMARIZES

Hey guys, I need some help, I have a problem....

 

Here I go...

 

I have a reimbursement app, where it summarizes based on the type of expense of the users, within them: Food, travel, others and transportation.

 

reembolso_resumos.png

 

However, the user needs to modify an item or the type of expense (food, travel, others or transportation), so how do I update my list on the sharepoint based on a form in the powerapps, without losing the other summaries that are already done?

14 REPLIES 14

Hi @Gorilla_8 ,

I also notice that you have this part:

Filter(ExpenseMaster;ID=Dropdown1.Selected.Result)

If you use formula like this:
Filter(....);;Filter(...)

It will return two tables.

While gallery only needs one table.

If you want to filter based on multiple rules, please combine them in one filter function.

Also, I've add this filter rule in my formula, please do not filter again.

Try this:

Filter(
        AddColumns(
                  GroupBy(listname;"userID","sumcost");
                 "Resumo Alimentação";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Alimentação"); 'Valor do gasto');
                 "Resumo Transporte";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Transporte"); 'Valor do gasto');
                 "Resumo Viagem";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Viagem"); 'Valor do gasto');
                 "Resumo Outros";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Outros"); 'Valor do gasto');
                  );
         ID=Dropdown1.Selected.Result
//I have already filter based on ID
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft 

 

I understand. But I got the same error:

 

error_show.png

 

And if I use the "userID"...

 

userid-errror.png

Hi @Gorilla_8 ,

Please notice the syntax of GroupBy:

GroupBy(table,"fielname","newfieldname")

You need to enter one fieldname in the second paramater.

userID is my fieldname in my test. In your issue, it seems that your fieldname is ID.

You need to replace with your fieldname.

Try this:

Filter(
        AddColumns(
                  GroupBy(listname;"ID","sumcost");
                 "Resumo Alimentação";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Alimentação"); 'Valor do gasto');
                 "Resumo Transporte";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Transporte"); 'Valor do gasto');
                 "Resumo Viagem";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Viagem"); 'Valor do gasto');
                 "Resumo Outros";
                 Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Outros"); 'Valor do gasto');
                  );
         ID=Dropdown1.Selected.Result
//I have already filter based on ID
)

If my formula still has some field names, values are not the name that you use in your issue, please all replace them.

 

 

Here's a doc about groupby function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft  Thanks for the help, and I dont get you I have to replace the "sumcost" or not?

yes, I read the documentation...but I dont get very wel...

 

And keep error going...

 

error_2.png

 

I got 'Sum' have invalid arguments

The name is invalid. this identifier is not recognized.

 

sorry for my ignorance

Hi @Gorilla_8 ,

1)You do not need to replace sumcost, this is the new column that you create by groupby function.

Please read the doc that I give you, the syntax of groupby function:

GroupBy(tablename, "fieldname","newfieldname")

2)You need to check these column names:

'Tipo de Despesa', 'Valor do gasto'

Please replace with the column names that you use.

3)You need to check whether 'Tipo de Despesa' field has these value:

Alimentação,Transporte ,Viagem,Outros

If not, please replace with all the value that you use in  'Tipo de Despesa'.

 

Many data/ fieldname are the test value that I use. You need to replace with yours, not use totally the same formula.

I think you need to know more about these functions:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates

I suggest you learn the parameters that the functions need.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,484)